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 162F2431FCF
\r
6 for <notmuch@notmuchmail.org>; Fri, 10 Oct 2014 11:31:40 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled
\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 xYhdcFGcZuC4 for <notmuch@notmuchmail.org>;
\r
17 Fri, 10 Oct 2014 11:31:32 -0700 (PDT)
\r
18 Received: from resqmta-po-09v.sys.comcast.net (resqmta-po-09v.sys.comcast.net
\r
20 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 205DD431FBC
\r
23 for <notmuch@notmuchmail.org>; Fri, 10 Oct 2014 11:31:32 -0700 (PDT)
\r
24 Received: from resomta-po-03v.sys.comcast.net ([96.114.154.227])
\r
25 by resqmta-po-09v.sys.comcast.net with comcast
\r
26 id 1WX91p0074ueUHc01WXX0y; Fri, 10 Oct 2014 18:31:31 +0000
\r
27 Received: from odin.tremily.us ([24.18.63.50])
\r
28 by resomta-po-03v.sys.comcast.net with comcast
\r
29 id 1WXV1p00N152l3L01WXWFa; Fri, 10 Oct 2014 18:31:31 +0000
\r
30 Received: by odin.tremily.us (Postfix, from userid 1000)
\r
31 id C8D29141181B; Fri, 10 Oct 2014 11:31:28 -0700 (PDT)
\r
32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;
\r
33 t=1412965888; bh=OHjjnlARVlLbrQNjHDa3IrS4SFCojkp6DOAFewgLaCs=;
\r
34 h=From:To:Cc:Subject:Date;
\r
35 b=Xp9aI3g52MyXGGG5xMfpNE1kPwgOHMSot356kNIxJVD/O595gF/kDM1Xs5ClZd/Qg
\r
36 zzsXPup/a8VMBbf6YC5RiFZ/Cbx7aTMlEnDnwbRXp7kK8YYnlrqC4XHCfwax5LRoOh
\r
37 hBMeP9lOer7rTW4IUz+Bs/VpDay0i2S82MLmViOY=
\r
38 From: "W. Trevor King" <wking@tremily.us>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH v2] nmbug: Add an 'init' command
\r
41 Date: Fri, 10 Oct 2014 11:31:25 -0700
\r
43 <eaa9cf1cb3c00c591dc675c0f314ca31909ff74c.1412965476.git.wking@tremily.us>
\r
44 X-Mailer: git-send-email 2.0.4
\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
46 s=q20140121; t=1412965891;
\r
47 bh=KowNf8zl7lx8pl/m3ghpWHr/QG/vFi/U5E5x+NJ5h1g=;
\r
48 h=Received:Received:Received:From:To:Subject:Date:Message-Id;
\r
49 b=Ws9INXanzvZFEz5RtLBUMSJIi8go6Tm89F5YPWteustyHc5hVDtUcuIP7XttdwWyt
\r
50 ou6N+hM8ldqjgjKWuVhlJpWDRgroMZTpMQyPU8IkjO9hO29c9yrKKrlsCFkfB3J5Yx
\r
51 KnA4rctzdElhxr6Ml7WkqmGXTvBjIZAT/RbAkja5ZwTm+08CR0JZLqG0Tqgk06CRvj
\r
52 v3c0b6Oe/shklYeOSMKJjjuJ5Tl4eVpopRY7Cm4X4wmhW/AwRjOVJKujFCyAJBSEOB
\r
53 7yWPYJsfDZnF6HOvcZgT1h7LTmamqXHfjVXDEwSB6/JDiYcLEXhbEHRzfI+a4uGg43
\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: Fri, 10 Oct 2014 18:31:40 -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
91 [1]: id:87y4vu6uvf.fsf@maritornes.cs.unb.ca
\r
92 http://thread.gmane.org/gmane.mail.notmuch.general/18626/focus=18720
\r
94 This is just like v1 [1], but rebased into the new Python nmbug. I'd
\r
95 initially supported the /dev/null approach [2], but have since gone
\r
96 back to my original --stdin approach for the empty blob object (as
\r
97 explained in the commit message). Sorry for waffling ;).
\r
102 [1]: id:05ccd672f55444f74da62250e2305fb84fdc6c42.1404678709.git.wking@tremily.us
\r
103 http://thread.gmane.org/gmane.mail.notmuch.general/18626/focus=18630
\r
104 [2]: id:20140716001239.GH30232@odin
\r
105 http://article.gmane.org/gmane.mail.notmuch.general/18722
\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