From: Tomi Ollila Date: Mon, 23 Mar 2015 07:06:13 +0000 (+0200) Subject: Re: [PATCH v4] nmbug-status: Use 'show-ref --heads' for loading configs X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e1bb6d4f9ff0d4598277552fbbdde558327dbe4;p=notmuch-archives.git Re: [PATCH v4] nmbug-status: Use 'show-ref --heads' for loading configs --- diff --git a/fe/e7451ecc0c7eb3123fad39af6d0b478736e130 b/fe/e7451ecc0c7eb3123fad39af6d0b478736e130 new file mode 100644 index 000000000..81577df5d --- /dev/null +++ b/fe/e7451ecc0c7eb3123fad39af6d0b478736e130 @@ -0,0 +1,138 @@ +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 EE4E9431FCB + for ; Mon, 23 Mar 2015 00:06:44 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 h9y7y86RhnI5 for ; + Mon, 23 Mar 2015 00:06:41 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 781CF431FC7 + for ; Mon, 23 Mar 2015 00:06:41 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 345BA100086; + Mon, 23 Mar 2015 09:06:14 +0200 (EET) +From: Tomi Ollila +To: "W. Trevor King" , notmuch@notmuchmail.org +Subject: Re: [PATCH v4] nmbug-status: Use 'show-ref --heads' for loading + configs +In-Reply-To: + <27b065bda7a31387f8f08069f30a2c2103ffc4e2.1427064160.git.wking@tremily.us> +References: + <27b065bda7a31387f8f08069f30a2c2103ffc4e2.1427064160.git.wking@tremily.us> +User-Agent: Notmuch/0.19+92~g61c04e8 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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: Mon, 23 Mar 2015 07:06:45 -0000 + +On Mon, Mar 23 2015, "W. Trevor King" wrote: + +> 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. +> --- +> The only change from v3 [1] is dropping the accidental indentation +> hunk that started with '@@ -178,14 +193,14 @@ nmbug-status'. Thanks +> to Tomi for pointing this out on IRC. + +LGTM. + +Tomi + + +> +> [1]: id: e9d25cc269b7bcc058627466adfa2835256b6e76.1427012574.git.wking@tremily.us +> http://thread.gmane.org/gmane.mail.notmuch.general/20356 +> +> NEWS | 15 +++++++++++++++ +> devel/nmbug/nmbug | 1 + +> devel/nmbug/nmbug-status | 2 +- +> 3 files changed, 17 insertions(+), 1 deletion(-) +> +> diff --git a/NEWS b/NEWS +> index 70ad3f3..336a7c3 100644 +> --- a/NEWS +> +++ b/NEWS +> @@ -23,6 +23,21 @@ Contrib +> previously provided by `notmuch-deliver` should now be provided by +> `notmuch insert`, provided by the main notmuch binary. +> +> +nmbug-status +> +------------ +> + +> +`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.19 (2014-11-14) +> ========================= +> +> diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug +> index 932ec12..81f582c 100755 +> --- a/devel/nmbug/nmbug +> +++ b/devel/nmbug/nmbug +> @@ -308,6 +308,7 @@ def clone(repository): +> wait=True) +> _git(args=['config', '--unset', 'core.worktree'], wait=True) +> _git(args=['config', 'core.bare', 'true'], wait=True) +> + _git(args=['branch', 'config', 'origin/config'], wait=True) +> +> +> def _is_committed(status): +> diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status +> index 19dc48a..e845c2a 100755 +> --- a/devel/nmbug/nmbug-status +> +++ b/devel/nmbug/nmbug-status +> @@ -92,7 +92,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: +> -- +> 2.1.0.60.g85f0837