1 Return-Path: <wking@tremily.us>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1F60B431FBC
\r
6 for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 14:48:53 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id iVAmIUFyDb92 for <notmuch@notmuchmail.org>;
\r
17 Tue, 28 Oct 2014 14:48:45 -0700 (PDT)
\r
18 X-Greylist: delayed 489 seconds by postgrey-1.32 at olra;
\r
19 Tue, 28 Oct 2014 14:48:45 PDT
\r
20 Received: from resqmta-ch2-12v.sys.comcast.net
\r
21 (resqmta-ch2-12v.sys.comcast.net [69.252.207.44])
\r
22 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
23 (No client certificate requested)
\r
24 by olra.theworths.org (Postfix) with ESMTPS id 9216D431FB6
\r
25 for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 14:48:45 -0700 (PDT)
\r
26 Received: from resomta-ch2-14v.sys.comcast.net ([69.252.207.110])
\r
27 by resqmta-ch2-12v.sys.comcast.net with comcast
\r
28 id 8lfU1p0032PT3Qt01lgaQd; Tue, 28 Oct 2014 21:40:34 +0000
\r
29 Received: from odin.tremily.us ([24.18.63.50])
\r
30 by resomta-ch2-14v.sys.comcast.net with comcast
\r
31 id 8lgZ1p00D152l3L01lgZgP; Tue, 28 Oct 2014 21:40:34 +0000
\r
32 Received: from mjolnir.tremily.us (unknown [192.168.0.150])
\r
33 by odin.tremily.us (Postfix) with ESMTPS id 20379143B66A;
\r
34 Tue, 28 Oct 2014 14:40:33 -0700 (PDT)
\r
35 Received: (nullmailer pid 1649 invoked by uid 1000);
\r
36 Tue, 28 Oct 2014 21:39:38 -0000
\r
37 From: "W. Trevor King" <wking@tremily.us>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v3] nmbug: Add an 'init' command
\r
40 Date: Tue, 28 Oct 2014 14:39:37 -0700
\r
42 <113512958b3fd64902517c1c55576faef816f852.1414532174.git.wking@tremily.us>
\r
43 X-Mailer: git-send-email 2.1.0.60.g85f0837
\r
44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
45 s=q20140121; t=1414532434;
\r
46 bh=+b4338FE6AR4rbuk0tiZed9tdCuvDYau4XsVIfQaSS8=;
\r
47 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
49 b=umb8KtLVK0aQXSX+N5ME3pVChcKAeRn4cX0RpdnWz+bVihv6NQNsQMbB047priOvT
\r
50 gpbfdUHc6oT2h6qiF/0rxko65/3fXvRh0orVmt5/Zw5KqLgnbbXa0BIqF4QdhUS1PV
\r
51 1nVC9plpRRT71FysS8O0rmPxSuLIhYMeysaCgHZdc7oVRbuZFryw10yFh99RFoQpB8
\r
52 qXKRWg3j6FLi5OuAhZXdsp0M6/Vzn7SIkdAxIpIySrP7jsk5BNzbgfMAqm0i5JuYPD
\r
53 PYkXcJI3EyjeTzfIZerlsZqeA4Cpj1tzAlWNm5+8rxH6eAkScFrqEW90WINOPOiWie
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Tue, 28 Oct 2014 21:48:53 -0000
\r
69 For folks that want to start versioning a new tag-space, instead of
\r
70 cloning one that someone else has already started.
\r
72 The empty-blob hash-object call avoids errors like:
\r
75 error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for
\r
77 fatal: git-write-tree: error building trees
\r
78 'git HASH(0x9ef3eb8) write-tree' exited with nonzero value
\r
80 David Bremner suggested [1]:
\r
82 $ git hash-object -w /dev/null
\r
84 instead of my Python version of:
\r
86 $ git hash-object -w --stdin <&-
\r
88 but I expect that closing stdin is more portable than the /dev/null
\r
89 path (which doesn't exist on Windows, for example).
\r
91 [1]: id:87y4vu6uvf.fsf@maritornes.cs.unb.ca
\r
92 http://thread.gmane.org/gmane.mail.notmuch.general/18626/focus=18720
\r
94 The only change since v2 [1] is a commit-message tweak:
\r
96 * Mention Windows as an OS with stdin but no /dev/null [2].
\r
101 [1]: id:eaa9cf1cb3c00c591dc675c0f314ca31909ff74c.1412965476.git.wking@tremily.us
\r
102 http://thread.gmane.org/gmane.mail.notmuch.general/19289
\r
103 [2]: id:20141011071000.GB10926@odin.tremily.us
\r
104 http://article.gmane.org/gmane.mail.notmuch.general/19294
\r
106 devel/nmbug/nmbug | 24 ++++++++++++++++++++++++
\r
107 1 file changed, 24 insertions(+)
\r
109 diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
\r
110 index 9402ead..23bac5c 100755
\r
111 --- a/devel/nmbug/nmbug
\r
112 +++ b/devel/nmbug/nmbug
\r
113 @@ -373,6 +373,29 @@ def fetch(remote=None):
\r
114 _git(args=args, wait=True)
\r
117 +def init(remote=None):
\r
119 + Create an empty nmbug repository.
\r
121 + This wraps 'git init' with a few extra steps to support subsequent
\r
122 + status and commit commands.
\r
124 + with _tempfile.TemporaryDirectory(prefix='nmbug-init.') as workdir:
\r
126 + args=['git', 'init', '--separate-git-dir', NMBGIT, workdir],
\r
128 + _git(args=['config', '--unset', 'core.worktree'], wait=True)
\r
129 + _git(args=['config', 'core.bare', 'true'], wait=True)
\r
130 + # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
\r
131 + _git(args=['hash-object', '-w', '--stdin'], input='', wait=True)
\r
134 + 'commit', '--allow-empty', '-m', 'Start a new nmbug repository'
\r
136 + additional_env={'GIT_WORK_TREE': workdir},
\r
142 Update the notmuch database from Git.
\r
143 @@ -703,6 +726,7 @@ if __name__ == '__main__':
\r