From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 IE4jDzWVm2Id1gAAbAwnHQ (envelope-from ) for ; Sat, 04 Jun 2022 19:24:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IHgcDzWVm2I+RgEA9RJhRA (envelope-from ) for ; Sat, 04 Jun 2022 19:24:05 +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 1806A45899 for ; Sat, 4 Jun 2022 19:24:01 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 26A085F7DD; Sat, 4 Jun 2022 17:23:37 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id D94615F7D0 for ; Sat, 4 Jun 2022 17:23:34 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 0F1575FC1F; Sat, 4 Jun 2022 13:23:33 -0400 (EDT) Received: (nullmailer pid 1150061 invoked by uid 1000); Sat, 04 Jun 2022 17:23:25 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH v3 04/17] CLI/git: make existance of config branch optional on clone Date: Sat, 4 Jun 2022 14:23:00 -0300 Message-Id: <20220604172313.1149879-5-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220604172313.1149879-1-david@tethera.net> References: <20220604172313.1149879-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: CLIYQLQMDDFYBVEUZXS7FZFZAGBLYPUL X-Message-ID-Hash: CLIYQLQMDDFYBVEUZXS7FZFZAGBLYPUL 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=1654363442; 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=STyvA7LdQyaa3cqEu6I/a0KzJk9GGvHKfIbW7mHX5k0=; b=WcWrnI0MwgzFOokMmLmdx1KaEtNijB99uVz5VCiHbFdpnmey0/L64YQnhem4Q7LLya/iU2 zt8D3AhWNvd5B+u8+7zcaLMe/jFXnG0RZgyb1G29vCIQyTgEKHHtyCKysGiNgJSZT8ii55 RDdhJdoVJHPAoDsdvxBhA4yuvZGGYZeMD6uDR0p21XjtgXXVRnYRtkArtAjLCpu0LC4oAD OMSh4gwNQq2lIGSxv3EvtDPNnzbktvtQEIMLp5bC/kCdSFantFOZbxRXDtpCAP7/0Da8L/ wckfIuRtTNTVlWThVVMKRvQHbFj5yJYXy9Vn5jGaOsrS8YDx4wngJGUkfkv2aA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654363442; a=rsa-sha256; cv=none; b=E3QOXXK/2J7ASOboo+GFpw4Ijjy7OQQzpQtwFBr49l2mX4o9bg1RSV3igOPYl8LpmvHIML teLvHISuNT8RsQGJhvVNixRcZ3YRzGryje+mrv8xc3BVuCwHoaSu1YaMZTqRuJtAR67xKG hNwtbUDMsR3KZU5BXT6vIkH+aWpqrGwgplSIZRzf70ek+i4e0AAaCDnX5SpLyI0xdXRMkI yaY6GZN29xJ3IPpsE8TdoW43P8YkdLz3wQ7IponNU2wUwW6bOoeten97ltN/DjkkudKlzV 6rzWLAJervd4g7UcsM31qpfIrz6WY0ihaUOY61XO5MEfSltd6Jf/3HR+Q+2YdQ== 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.05 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: 1806A45899 X-Spam-Score: -1.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: /QcyA5gBJDrD This branch is actually only used by an associated utility (notmuch-report), and notmuch-git works fine without it. --- notmuch-git.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/notmuch-git.py b/notmuch-git.py index 34d07125..0cbfec61 100644 --- a/notmuch-git.py +++ b/notmuch-git.py @@ -271,7 +271,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( -- 2.35.2