Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 7c / 82a9ff9935e97142de146f1c06722f5782912c
1 Return-Path: <sojkam1@fel.cvut.cz>\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 19D43431FBF\r
6         for <notmuch@notmuchmail.org>; Sat, 29 Nov 2014 02:17:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id LRSqvWindEKw for <notmuch@notmuchmail.org>;\r
16         Sat, 29 Nov 2014 02:17:00 -0800 (PST)\r
17 Received: from smtp.nextra.cz (smtp.nextra.cz [212.65.193.3])\r
18         by olra.theworths.org (Postfix) with ESMTP id 98F00431FAE\r
19         for <notmuch@notmuchmail.org>; Sat, 29 Nov 2014 02:17:00 -0800 (PST)\r
20 Received: from resox (unknown [213.29.198.144])\r
21         by smtp.nextra.cz (Postfix) with ESMTP id 5151C4A768;\r
22         Sat, 29 Nov 2014 11:16:50 +0100 (CET)\r
23 Received: from wsh by resox with local (Exim 4.84)\r
24         (envelope-from <sojkam1@fel.cvut.cz>)\r
25         id 1XueVV-0007F1-VH; Sat, 29 Nov 2014 10:40:01 +0100\r
26 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
27 To: "W. Trevor King" <wking@tremily.us>, notmuch@notmuchmail.org\r
28 Subject: Re: [PATCH v3] nmbug: Add an 'init' command\r
29 In-Reply-To:\r
30  <113512958b3fd64902517c1c55576faef816f852.1414532174.git.wking@tremily.us>\r
31 References:\r
32  <113512958b3fd64902517c1c55576faef816f852.1414532174.git.wking@tremily.us>\r
33 User-Agent: Notmuch/0.19~rc1+7~gdb5e73a (http://notmuchmail.org) Emacs/24.4.1\r
34         (x86_64-pc-linux-gnu)\r
35 Date: Sat, 29 Nov 2014 10:40:01 +0100\r
36 Message-ID: <87a93a5or2.fsf@resox.2x.cz>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain; charset=utf-8\r
39 Content-Transfer-Encoding: quoted-printable\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Sat, 29 Nov 2014 10:17:09 -0000\r
53 \r
54 Hi Trevor,\r
55 \r
56 On =C3=9At, =C5=99=C3=ADj 28 2014, W. Trevor King wrote:\r
57 > For folks that want to start versioning a new tag-space, instead of\r
58 > cloning one that someone else has already started.\r
59 >\r
60 > The empty-blob hash-object call avoids errors like:\r
61 >\r
62 >   $ nmbug commit\r
63 >   error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 f=\r
64 or\r
65 > 'tags/...'\r
66 >   fatal: git-write-tree: error building trees\r
67 >   'git HASH(0x9ef3eb8) write-tree' exited with nonzero value\r
68 >\r
69 > David Bremner suggested [1]:\r
70 >\r
71 >   $ git hash-object -w /dev/null\r
72 >\r
73 > instead of my Python version of:\r
74 >\r
75 >   $ git hash-object -w --stdin <&-\r
76 >\r
77 > but I expect that closing stdin is more portable than the /dev/null\r
78 > path (which doesn't exist on Windows, for example).\r
79 >\r
80 > [1]: id:87y4vu6uvf.fsf@maritornes.cs.unb.ca\r
81 >      http://thread.gmane.org/gmane.mail.notmuch.general/18626/focus=3D187=\r
82 20\r
83 > ---\r
84 > The only change since v2 [1] is a commit-message tweak:\r
85 >\r
86 > * Mention Windows as an OS with stdin but no /dev/null [2].\r
87 >\r
88 > Cheers,\r
89 > Trevor\r
90 >\r
91 > [1]: id:eaa9cf1cb3c00c591dc675c0f314ca31909ff74c.1412965476.git.wking@tre=\r
92 mily.us\r
93 >      http://thread.gmane.org/gmane.mail.notmuch.general/19289\r
94 > [2]: id:20141011071000.GB10926@odin.tremily.us\r
95 >      http://article.gmane.org/gmane.mail.notmuch.general/19294\r
96 >\r
97 >  devel/nmbug/nmbug | 24 ++++++++++++++++++++++++\r
98 >  1 file changed, 24 insertions(+)\r
99 >\r
100 > diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug\r
101 > index 9402ead..23bac5c 100755\r
102 > --- a/devel/nmbug/nmbug\r
103 > +++ b/devel/nmbug/nmbug\r
104 > @@ -373,6 +373,29 @@ def fetch(remote=3DNone):\r
105 >      _git(args=3Dargs, wait=3DTrue)\r
106 >=20=20\r
107 >=20=20\r
108 > +def init(remote=3DNone):\r
109 > +    """\r
110 > +    Create an empty nmbug repository.\r
111 > +\r
112 > +    This wraps 'git init' with a few extra steps to support subsequent\r
113 > +    status and commit commands.\r
114 > +    """\r
115 > +    with _tempfile.TemporaryDirectory(prefix=3D'nmbug-init.') as workdir:\r
116 > +        _spawn(\r
117 > +            args=3D['git', 'init', '--separate-git-dir', NMBGIT, workdir=\r
118 ],\r
119 > +            wait=3DTrue)\r
120 > +        _git(args=3D['config', '--unset', 'core.worktree'], wait=3DTrue)\r
121 > +        _git(args=3D['config', 'core.bare', 'true'], wait=3DTrue)\r
122 \r
123 Why do you create a non-bare repository and then make it bare? Before I\r
124 discovered this patch, I created the nmbug repository by hand and it was\r
125 possible to do it with bare repo from beginning. The following code\r
126 seems to work and is a bit simpler:\r
127 \r
128 def init(remote=3DNone):\r
129     """\r
130     Create an empty nmbug repository.\r
131 \r
132     This wraps 'git init' with a few extra steps to support subsequent\r
133     status and commit commands.\r
134     """\r
135     _spawn(\r
136         args=3D['git', '--git-dir', NMBGIT, 'init', '--bare'],\r
137         wait=3DTrue)\r
138     # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)\r
139     _git(args=3D['hash-object', '-w', '--stdin'], input=3D'', wait=3DTrue)\r
140     _git(\r
141         args=3D[\r
142             'commit', '--allow-empty', '-m', 'Start a new nmbug repository'\r
143             ],\r
144         additional_env=3D{'GIT_WORK_TREE': NMBGIT},\r
145         wait=3DTrue)\r
146 \r
147 Note that in the initial commit I set the work tree to NMBGIT. This is\r
148 because 'git commit' needs some work tree, but in our case it doesn't\r
149 matter which one because the commit is empty.\r
150 \r
151 -Michal\r
152 \r
153 \r
154 > +        # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)\r
155 > +        _git(args=3D['hash-object', '-w', '--stdin'], input=3D'', wait=\r
156 =3DTrue)\r
157 > +        _git(\r
158 > +            args=3D[\r
159 > +                'commit', '--allow-empty', '-m', 'Start a new nmbug repo=\r
160 sitory'\r
161 > +                ],\r
162 > +            additional_env=3D{'GIT_WORK_TREE': workdir},\r
163 > +            wait=3DTrue)\r
164 > +\r
165 > +\r
166 >  def checkout():\r
167 >      """\r
168 >      Update the notmuch database from Git.\r
169 > @@ -703,6 +726,7 @@ if __name__ =3D=3D '__main__':\r
170 >              'clone',\r
171 >              'commit',\r
172 >              'fetch',\r
173 > +            'init',\r
174 >              'log',\r
175 >              'merge',\r
176 >              'pull',\r
177 > --=20\r
178 > 2.1.0.60.g85f0837\r
179 >\r
180 > _______________________________________________\r
181 > notmuch mailing list\r
182 > notmuch@notmuchmail.org\r
183 > http://notmuchmail.org/mailman/listinfo/notmuch\r