From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UOf4KYwBZGJ6FQAAbAwnHQ (envelope-from ) for ; Sat, 23 Apr 2022 15:39:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oDn3KYwBZGKnggAAauVa8A (envelope-from ) for ; Sat, 23 Apr 2022 15:39:24 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2D38814F8C for ; Sat, 23 Apr 2022 15:39:24 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8F6A15F767; Sat, 23 Apr 2022 13:39:06 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id E4CFB5F75E for ; Sat, 23 Apr 2022 13:39:02 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 2E3115FBD7; Sat, 23 Apr 2022 09:39:01 -0400 (EDT) Received: (nullmailer pid 3856563 invoked by uid 1000); Sat, 23 Apr 2022 13:38:57 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 08/16] CLI/git: make existance of config branch optional on clone Date: Sat, 23 Apr 2022 10:38:40 -0300 Message-Id: <20220423133848.3852688-9-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220423133848.3852688-1-david@tethera.net> References: <20220423133848.3852688-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 6FWEGO6676XB3OJLWRWNM5WWTFETYQQ7 X-Message-ID-Hash: 6FWEGO6676XB3OJLWRWNM5WWTFETYQQ7 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650721164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=7HthXQss2f02HMOqCc6Dln+gyR5AGlt6kO89Pj+w/+E=; b=N04gNOb88yAFT0G1imX4vzxFyivfottxvIjRBSwTL318lSqq9uwn5Q7QxOPAXJv8DOtNxf 6OCYPyHrVuBc4dZajB37/WFY9AW/XLEp1RzVrM2k08T4zmduegVXE1q2nx+/kC7h52lwA2 ZaBKq/yFCX8sMYAp+L+R9zJ/c79M+Yg/o23pbyVfV/n7uCAUo1VKbHTEsL7gggXIgu6VfB mtFOndo6Q45Z2AI2kyv/y8s4ncst8tZMuXi49IheukOofe6CvFEvbSRjvQVCCoCbEsKnaL LRJvbZeGaIhy2yWYHx4g0jdfALZ3YQzmuCuwAo5mbOSTOl+N7ygpDRveLQ+J4w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650721164; a=rsa-sha256; cv=none; b=hGWPt2PRjCmftU46GBw5HXMettn64KmAJQZM9Zt1sZNjUNuqFfyW4hWouxZi7OP6jelhS4 iV4RE93f2qJAtps/yLuynSZtIEhqmLs4wkkYSY2dr07xiglNbNmrHm7vo6kv3mdg5qXf37 SC3Gipo8DodnXhzIijOwDc9+SzVw/5unLdt96zabKYk3F0omzBdGNRvDIOiNQKBa4WRyyg RpILhzTXaC6Z2pnSDlgfeW1IsspvZMhwQ5MeBEiuq2HAUZjSCGBHe4SwGgi31THsGMbyt9 HC/5M5WPil3T3zwfrFQkfSSFTmLTHiiZVV3Wp84Tzr5YEMgky6s6kc3YZf1aBQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 2D38814F8C X-Spam-Score: -1.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: wDuNEn0Hx21U This branch is actually only used by an associated utility (notmuch-report), and notmuch-git works fine without it. With this change we can use "notmuch git clone" in the setup for the tests in T850-git.sh --- notmuch-git.in | 8 +++++++- test/T850-git.sh | 9 +-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/notmuch-git.in b/notmuch-git.in index 3a58fd28..8b397080 100755 --- a/notmuch-git.in +++ b/notmuch-git.in @@ -303,7 +303,13 @@ def clone(repository): wait=True) _git(args=['config', '--unset', 'core.worktree'], wait=True, expect=(0, 5)) _git(args=['config', 'core.bare', 'true'], wait=True) - _git(args=['branch', 'config', 'origin/config'], wait=True) + (status, stdout, stderr) = _git(args=['show-ref', '--verify', + '--quiet', + 'refs/remotes/origin/config'], + expect=(0,1), + wait=True) + if status == 0: + _git(args=['branch', 'config', 'origin/config'], wait=True) existing_tags = get_tags() if existing_tags: _LOG.warning( diff --git a/test/T850-git.sh b/test/T850-git.sh index d682141f..417692d4 100755 --- a/test/T850-git.sh +++ b/test/T850-git.sh @@ -4,20 +4,13 @@ test_description='"notmuch git" to save and restore tags' add_git_repos () { notmuch git -C remote.git -p '' init - - # now make a "local" repo to work on - git clone --bare --quiet remote.git tags.git - git -C tags.git config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git -C tags.git fetch origin - git -C tags.git branch -u origin/master master + notmuch git -C tags.git -p '' clone remote.git } add_email_corpus add_git_repos test_begin_subtest "clone" -# currently broken because of hard-wired requirement for config branch -test_subtest_known_broken test_expect_success "notmuch git -C clone.git clone tags.git" test_begin_subtest "commit" -- 2.35.2