From: W. Trevor King Date: Sun, 22 Mar 2015 08:31:09 +0000 (+1700) Subject: [PATCH v3] nmbug-status: Use 'show-ref --heads' for loading configs X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6be9cc1a595ef5c719f756165e52e468c2a179e6;p=notmuch-archives.git [PATCH v3] nmbug-status: Use 'show-ref --heads' for loading configs --- diff --git a/5d/3cead6b34ebac632bdc22f11078deaebad1b91 b/5d/3cead6b34ebac632bdc22f11078deaebad1b91 new file mode 100644 index 000000000..8ce9a7f63 --- /dev/null +++ b/5d/3cead6b34ebac632bdc22f11078deaebad1b91 @@ -0,0 +1,172 @@ +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 3256D431FB6 + for ; Sun, 22 Mar 2015 01:31:20 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.338 +X-Spam-Level: ** +X-Spam-Status: No, score=2.338 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + 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 ysvOG8kDn30r for ; + Sun, 22 Mar 2015 01:31:16 -0700 (PDT) +Received: from resqmta-po-04v.sys.comcast.net (resqmta-po-04v.sys.comcast.net + [96.114.154.163]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 71129431FAE + for ; Sun, 22 Mar 2015 01:31:16 -0700 (PDT) +Received: from resomta-po-03v.sys.comcast.net ([96.114.154.227]) + by resqmta-po-04v.sys.comcast.net with comcast + id 6YXE1q0024ueUHc01YXEFa; Sun, 22 Mar 2015 08:31:14 +0000 +Received: from odin.tremily.us ([67.168.81.176]) + by resomta-po-03v.sys.comcast.net with comcast + id 6YXB1q0063oF5yT01YXBSW; Sun, 22 Mar 2015 08:31:14 +0000 +Received: by odin.tremily.us (Postfix, from userid 1000) + id 5757D16D6865; Sun, 22 Mar 2015 01:31:11 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; + t=1427013071; bh=tN83NNTXxLXHw2/7mI1rE6sQqRpKYQeynaM7Rmm7NAE=; + h=From:To:Cc:Subject:Date; + b=p3dxUBu+d1OjpKSuMqcEXWQTmKYLndUU0p6n8AoFxPZMa1P1cvBMaDr5ake3n4G+L + jYL2UiFO5oXtmrS4x/iGbDM7OrCpFjrTK4dZJ771773jHZAQ+3+4clyh6Z59vvjydU + MqauV//9g3mEZ4TUl7qaTlMuthirlur3rIKO95N0= +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH v3] nmbug-status: Use 'show-ref --heads' for loading configs +Date: Sun, 22 Mar 2015 01:31:09 -0700 +Message-Id: + +X-Mailer: git-send-email 2.0.5 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20140121; t=1427013074; + bh=5HQHI2D1woA/MJ8y1NlfwCdxKIQPvLjsash4t7OluZM=; + h=Received:Received:Received:From:To:Subject:Date:Message-Id; + b=WVc0wdqq0J3aNM99zz2DSh9olSj35IVAt5zRaUq/n1GaQf1W5DsC2DNyAXUCuoEOi + sMyeqHWd4hflf/8Vh+Q9jkUxN7gtEiqsdSamhfDGgWuAt0hvQMj0U6xr//5rVyQ68l + As4hHdc2kI/XgpMhMd2V+cy5lH/ckvtHOSM7ST8yfh/l1ZEvMIsiiiGB3pZ/8QuJgS + lFQTvQ6+T1bCB53FaPUhdp1LsOiSM8VczVY5WO16L/jCf9vFtpUOecuYRpClYwkvBH + S5Un5VwltOXM2WwmiKxEkW0PpmEoQx/Xb60D6WqFlUWkYdDsPftQVUMY5P8fQ618Ph + P5CKBYMVeff6Q== +Cc: Tomi Ollila +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: Sun, 22 Mar 2015 08:31:20 -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. +--- +The only change since v2 [1] is shifting the NEWS entry into the +unreleased 0.20 section [2]. + +[1]: id:5e97afaab6c01e980ca6194a1c04aa0310e28ab8.1426412504.git.wking@tremily.us + http://thread.gmane.org/gmane.mail.notmuch.general/20344/ +[2]: id:m2bnjm7o16.fsf@guru.guru-group.fi + http://article.gmane.org/gmane.mail.notmuch.general/20350 + + + NEWS | 31 +++++++++++++++++++++++-------- + devel/nmbug/nmbug | 1 + + devel/nmbug/nmbug-status | 2 +- + 3 files changed, 25 insertions(+), 9 deletions(-) + +diff --git a/NEWS b/NEWS +index 70ad3f3..de13bbd 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) + ========================= + +@@ -178,14 +193,14 @@ nmbug-status + `nmbug-status` can now optionally load header and footer templates + from the config file. Use something like: + +- { +- "meta": { +- "header": "\n\n...", +- "footer": "", +- ... +- }, +- ... +- }, ++{ ++"meta": { ++"header": "\n\n...", ++"footer": "", ++... ++}, ++... ++}, + + Python Bindings + --------------- +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 +