unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "W. Trevor King" <wking@tremily.us>
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	[thread overview]
Message-ID: <7ddcf7368895768aa0a2d37dac0d4f96e9666f16.1399749244.git.wking@tremily.us> (raw)
In-Reply-To: <cover.1399749244.git.wking@tremily.us>
In-Reply-To: <cover.1399749244.git.wking@tremily.us>

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

  parent reply	other threads:[~2014-05-10 19:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10 19:16 [PATCH 0/2] nmbug-config errors for illegible configs W. Trevor King
2014-05-10 19:16 ` [PATCH 1/2] nmbug-status: Clarify " W. Trevor King
2014-07-13 12:28   ` David Bremner
2015-03-15  8:32   ` David Bremner
2015-03-15  9:34     ` W. Trevor King
2014-05-10 19:16 ` W. Trevor King [this message]
2014-07-13 12:30   ` [PATCH 2/2] nmbug-status: Use 'show-ref --heads' for loading configs David Bremner
2014-07-13 18:13     ` W. Trevor King
2014-07-14  9:51       ` David Bremner
2014-07-14 17:52         ` W. Trevor King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ddcf7368895768aa0a2d37dac0d4f96e9666f16.1399749244.git.wking@tremily.us \
    --to=wking@tremily.us \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).