From f6c9248530084f95177bd9a17d3402e8df4a70a9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 11 May 2014 12:16:39 +1700 Subject: [PATCH] [PATCH 2/2] nmbug-status: Use 'show-ref --heads' for loading configs --- 3b/79944fee0c92a5fc7bb90e893a2ab6fab52a4d | 140 ++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 3b/79944fee0c92a5fc7bb90e893a2ab6fab52a4d diff --git a/3b/79944fee0c92a5fc7bb90e893a2ab6fab52a4d b/3b/79944fee0c92a5fc7bb90e893a2ab6fab52a4d new file mode 100644 index 000000000..b39b9e2df --- /dev/null +++ b/3b/79944fee0c92a5fc7bb90e893a2ab6fab52a4d @@ -0,0 +1,140 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 16962431FD6 + for ; Sat, 10 May 2014 12:17:33 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id s1AEZXYEJp+J for ; + Sat, 10 May 2014 12:17:27 -0700 (PDT) +Received: from qmta10.westchester.pa.mail.comcast.net + (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) + by olra.theworths.org (Postfix) with ESMTP id 4567F431FC2 + for ; Sat, 10 May 2014 12:17:24 -0700 (PDT) +Received: from omta06.westchester.pa.mail.comcast.net ([76.96.62.51]) + by qmta10.westchester.pa.mail.comcast.net with comcast + id 0K4p1o00116LCl05AKHL3r; Sat, 10 May 2014 19:17:20 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by omta06.westchester.pa.mail.comcast.net with comcast + id 0KHG1o00P152l3L3SKHHd1; Sat, 10 May 2014 19:17:18 +0000 +Received: from mjolnir.tremily.us (unknown [192.168.0.140]) + by odin.tremily.us (Postfix) with ESMTPS id 58AB4119F4AF; + Sat, 10 May 2014 12:17:16 -0700 (PDT) +Received: (nullmailer pid 7966 invoked by uid 1000); + Sat, 10 May 2014 19:16:43 -0000 +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] nmbug-status: Use 'show-ref --heads' for loading configs +Date: Sat, 10 May 2014 12:16:39 -0700 +Message-Id: + <7ddcf7368895768aa0a2d37dac0d4f96e9666f16.1399749244.git.wking@tremily.us> +X-Mailer: git-send-email 1.9.1.353.gc66d89d +In-Reply-To: +References: +In-Reply-To: +References: +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20140121; t=1399749440; + bh=iZQIHHMOntfhaLmAKrWxUN0aMVer0CrkzfYK3f5SqM4=; + h=Received:Received:Received:Received:From:To:Subject:Date: + Message-Id; + b=GWfs3fZfhfWTdbBSqjd0cErZsXo4HIW9M3lGwJehe6SWcuMadv3qhcGA//CdPFB0P + F1DjbpcfIGK9mtwIoD15xOJowFuKlCTfkZT/idoFrLbYJhaj6uv4zhTv8S1sB/WbRC + YyyTVuE1iDTGg/cCI9AsCvLoSjXPjbJaT4VWSA5YO3G/N19gjg5loVr3Q+AjOTHR+t + /4k45p9yGI7xg6/oQ+exscg+PAhndfeV2B+Av8URhPE6Ghc3qOHIim53QtLst2QGT9 + Ew09rEojf/S7QCJhB2Oklk07IuJqlYLaeVVu5bmbfIipv+DqHurVLNjEgV20y0ApXt + bFZ91eIMAyDbA== +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 10 May 2014 19:17:33 -0000 + +When loading configs from Git, the bare branch name (without a +refs/heads/ prefix or similar) matches all branches of that name +(including remote-tracking branches): + + .nmbug $ git show-ref config + 48f3bbf1d1492e5f3d2f01de6ea79a30d3840f20 refs/heads/config + 48f3bbf1d1492e5f3d2f01de6ea79a30d3840f20 refs/remotes/origin/config + 4b6dbd9ffd152e7476f5101eff26747f34497cee refs/remotes/wking/config + +Instead of relying on the ordering of the matching references, use +--heads to ensure we only match local branches. +--- + NEWS | 18 ++++++++++++++++++ + devel/nmbug/nmbug | 1 + + devel/nmbug/nmbug-status | 2 +- + 3 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/NEWS b/NEWS +index bcd311d..5f7d30a 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,21 @@ ++Notmuch 0.19 (UNRELEASED) ++========================= ++ ++nmbug ++----- ++ ++`nmbug-status` now only matches local branches when reading ++`status-config.json` from the `config` branch of the `NMBGIT` ++repository. To help new users running `nmbug-status`, `nmbug clone` ++now creates a local `config` branch tracking `origin/config`. Folks ++who use `nmbug-status` with an in-Git config (i.e. you don't use the ++`--config` option) who already have `NMBGIT` set up are encouraged to ++run: ++ ++ git checkout config origin/config ++ ++in their `NMBGIT` repository (usually `~/.nmbug`). ++ + Notmuch 0.18~rc0 (2014-04-22) + ============================= + +diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug +index b18ded7..c6793a5 100755 +--- a/devel/nmbug/nmbug ++++ b/devel/nmbug/nmbug +@@ -135,6 +135,7 @@ sub do_clone { + or die "'git clone' exited with nonzero value\n"; + git ('config', '--unset', 'core.worktree'); + git ('config', 'core.bare', 'true'); ++ git ('branch', 'config', 'origin/config'); + } + + sub is_committed { +diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status +index 75a6e47..610c281 100755 +--- a/devel/nmbug/nmbug-status ++++ b/devel/nmbug/nmbug-status +@@ -72,7 +72,7 @@ def read_config(path=None, encoding=None): + + # read only the first line from the pipe + sha1_bytes = subprocess.Popen( +- ['git', '--git-dir', nmbhome, 'show-ref', '-s', branch], ++ ['git', '--git-dir', nmbhome, 'show-ref', '-s', '--heads', branch], + stdout=subprocess.PIPE).stdout.readline() + sha1 = sha1_bytes.decode(encoding).rstrip() + if not sha1: +-- +1.9.1.353.gc66d89d + -- 2.26.2