[PATCH v3 6/8] man: document notmuch count --output=files
[notmuch-archives.git] / 26 / 4dc0e1649a390d8514ab817db741ed12b75d6a
1 Return-Path: <amdragon@mit.edu>\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 5113A429E21\r
6         for <notmuch@notmuchmail.org>; Sun, 11 Sep 2011 17:21:03 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 TF1FI7JjZL+z for <notmuch@notmuchmail.org>;\r
16         Sun, 11 Sep 2011 17:21:02 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
18         [18.9.25.14])\r
19         by olra.theworths.org (Postfix) with ESMTP id 6F6E5431FB6\r
20         for <notmuch@notmuchmail.org>; Sun, 11 Sep 2011 17:21:02 -0700 (PDT)\r
21 X-AuditID: 1209190e-b7c60ae000000a26-cf-4e6d4fe0ed82\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id A4.26.02598.0EF4D6E4; Sun, 11 Sep 2011 20:18:40 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id p8C0KxuV022843; \r
27         Sun, 11 Sep 2011 20:21:00 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p8C0Kw6E006017\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Sun, 11 Sep 2011 20:20:58 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1R2uJ5-0000Q6-A9; Sun, 11 Sep 2011 20:23:27 -0400\r
37 Date: Sun, 11 Sep 2011 20:23:27 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Martin Owens <doctormo@gmail.com>\r
40 Subject: Re: Patch: Flush and Reopen\r
41 Message-ID: <20110912002327.GC23603@mit.edu>\r
42 References: <1315445674.32058.183.camel@delen>\r
43         <CAH-f9WtuYYuksfTHL1ZMmoRF6kyL7iFu9BXDzGn-wWGniSvf9w@mail.gmail.com>\r
44         <1315536861.2435.34.camel@delen> <87obyuj7q1.fsf@zancas.localnet>\r
45         <1315590950.2435.59.camel@delen>\r
46         <CAH-f9WtuL48RtaJ9njxHyCy5cqhhrxdz+30ydE11rq41Lu06pA@mail.gmail.com>\r
47         <1315615433.2435.62.camel@delen>\r
48 MIME-Version: 1.0\r
49 Content-Type: text/plain; charset=us-ascii\r
50 Content-Disposition: inline\r
51 In-Reply-To: <1315615433.2435.62.camel@delen>\r
52 User-Agent: Mutt/1.5.20 (2009-06-14)\r
53 X-Brightmail-Tracker:\r
54  H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42IR4hRV1n3gn+tncOy5vMWN1m5Gi3n3/zJb\r
55         XL85k9mB2WPnrLvsHs9W3WL22HLoPXMAcxSXTUpqTmZZapG+XQJXxsy/t5gLFmlV/F/wiq2B\r
56         8bZCFyMnh4SAicTtdS+YIWwxiQv31rN1MXJxCAnsY5R4ffoaI4SzgVFi0Z+F7BDOSSaJmUdP\r
57         MEM4SxglHlzZwg7SzyKgKnH2ynkmEJtNQENi2/7ljCC2CFB8UmsrK4jNLJAgsXjra7AaYQEV\r
58         iemrbrGB2LwCOhKTp4H0ggw9wSTxoHEnI0RCUOLkzCcsEM1aEjf+vQQq4gCypSWW/+MACXMK\r
59         6Eos/dUINlMUaOa1/e1sExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6\r
60         xnq5mSV6qSmlmxjB4S7Jt4Px60GlQ4wCHIxKPLyB13L8hFgTy4orcw8xSnIwKYnyKvrl+gnx\r
61         JeWnVGYkFmfEF5XmpBYfYpTgYFYS4W3QAyrnTUmsrEotyodJSXOwKInzrt7h4CckkJ5Ykpqd\r
62         mlqQWgSTleHgUJLgPQWMayHBotT01Iq0zJwShDQTByfIcB6g4ftBaniLCxJzizPTIfKnGBWl\r
63         xHkvgSQEQBIZpXlwvbB09IpRHOgVYd4vIFU8wFQG1/0KaDAT0OCA7Zkgg0sSEVJSDYziumnP\r
64         Dr9WFcrYXH6s+kZWMkPD13Qu2yvbTV2W3t/aGa26/hTXJTOZ+xECwm8bb39dvOXBtHkbvToN\r
65         /pxj32bTZTDTNeKCvsuO/zJX9T+Uit756vdQ+9ECtiYjhku3lvz9oPLl2OJlja+1r0j5pqrf\r
66         TRP+86OypPJGTb5nst/ClPfGeXt3XeNVYinOSDTUYi4qTgQAA0ziIiIDAAA=\r
67 Cc: Notmuch developer list <notmuch@notmuchmail.org>\r
68 X-BeenThere: notmuch@notmuchmail.org\r
69 X-Mailman-Version: 2.1.13\r
70 Precedence: list\r
71 List-Id: "Use and development of the notmuch mail system."\r
72         <notmuch.notmuchmail.org>\r
73 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
76 List-Post: <mailto:notmuch@notmuchmail.org>\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
78 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
79         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
80 X-List-Received-Date: Mon, 12 Sep 2011 00:21:03 -0000\r
81 \r
82 BTW, in the future, you should send patches inline (see the patch\r
83 formatting guide I linked to earlier for easy ways to do this).  It\r
84 makes them much easier to review and reply to.\r
85 \r
86 Quoth Martin Owens on Sep 09 at  8:43 pm:\r
87 > On Fri, 2011-09-09 at 19:40 -0400, Austin Clements wrote:\r
88 > > \r
89 > > (indented correctly, of course).  Reopen is a method of\r
90 > > Xapian::Database, which is what notmuch->xapian_db is anyway (unlike,\r
91 > > flush, which is a member of the subclass WritableDatabase and hence\r
92 > > requires the cast).  And reopening is a sensible thing to do on both\r
93 > > read-only and read/write databases.\r
94\r
95 > See attached for the removal of the cast and conditional for reopen.\r
96 \r
97 Great.  That looks like how I would expect a reopen function to work.\r
98 I assume you've tested it?\r
99 \r
100 Speaking of testing, I'm not sure what the best way to test this is,\r
101 but it needs something.  notmuch's testing system is great for testing\r
102 the CLI, but it's poorly suited to lower-level library things.\r
103 \r
104 > > Also, in keeping with notmuch code style, you should use tabs for\r
105 > > indentation and put a space before the open paren argument lists. \r
106\r
107 > I couldn't detect a consistant style for the tab/spacing and it confused\r
108 > me greatly. Especially coming from python where spacing is critical.\r
109\r
110 > I've put in tabs, not sure if I've put in enough in the form required.\r
111 \r
112 Notmuch is quite consistent about indentation, though the rule may not\r
113 be something you'd expect coming from Python.  It uses four space\r
114 indentation, but each group of eight spaces is replaced with a tab, so\r
115 for example\r
116 \r
117 notmuch_database_reopen (notmuch_database_t *notmuch)\r
118 {\r
119 ____try {\r
120 ->      notmuch->xapian_db->reopen ();\r
121 ____} catch (const Xapian::Error &error) {\r
122 ->      if (! notmuch->exception_reported) {\r
123 ->      ____fprintf (stderr, "Error: A Xapian exception occurred reopening database: %s\n",\r
124 ->      ->      _____error.get_msg().c_str());\r
125 ->      }\r
126 ____}\r
127 }\r
128 \r
129 Yeah, it's weird; blame RMS.  If you're using Emacs, the\r
130 .dir-locals.el should set this up automatically for you.  (If you're\r
131 not using Emacs, the easiest way might be to pop it up in Emacs,\r
132 select the code to indent, and do M-x indent-region.)\r
133 \r
134 > diff --git a/debian/changelog b/debian/changelog\r
135 > index c2b7552..565edfb 100644\r
136 > --- a/debian/changelog\r
137 > +++ b/debian/changelog\r
138 > @@ -1,8 +1,12 @@\r
139 >  notmuch (0.8~rc1-1) experimental; urgency=low\r
140 >  \r
141 > +  [ David Bremner ]\r
142 >    * Upstream release candidate.\r
143 >  \r
144 > - -- David Bremner <bremner@debian.org>  Tue, 06 Sep 2011 22:24:24 -0300\r
145 > +  [ Martin Owens (DoctorMO) ]\r
146 > +  * Re-new-world-order\r
147 > +\r
148 > + -- Martin Owens (DoctorMO) <doctormo@gmail.com>  Wed, 07 Sep 2011 18:19:50 -0400\r
149 >  \r
150 >  notmuch (0.7-1) unstable; urgency=low\r
151 >  \r
152 > diff --git a/debian/control b/debian/control\r
153 > index 03afdf4..a72fe1b 100644\r
154 > --- a/debian/control\r
155 > +++ b/debian/control\r
156 > @@ -5,7 +5,7 @@ Maintainer: Carl Worth <cworth@debian.org>\r
157 >  Uploaders: Jameson Graef Rollins <jrollins@finestructure.net>, martin f. krafft <madduck@debian.org>, \r
158 >            David Bremner <bremner@debian.org>\r
159 >  Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxapian-dev, \r
160 > - libgmime-2.4-dev, libtalloc-dev, libz-dev,  python-all (>= 2.6.6-3~),\r
161 > + libgmime-2.4-dev, libtalloc-dev, libz-dev,  python-all (>= 2.6.6),\r
162 >   emacs23-nox | emacs23 (>=23~) | emacs23-lucid (>=23~)\r
163 >  Standards-Version: 3.9.2\r
164 >  Homepage: http://notmuchmail.org/\r
165 \r
166 Even if you found the above two changes necessary, they shouldn't be\r
167 included in this patch because they aren't related to reopen/flush.\r
168 \r
169 > --- a/lib/database.cc\r
170 > +++ b/lib/database.cc\r
171 > @@ -700,18 +700,36 @@ notmuch_database_open (const char *path,\r
172 >  }\r
173 >  \r
174 >  void\r
175 > -notmuch_database_close (notmuch_database_t *notmuch)\r
176 > +notmuch_database_reopen (notmuch_database_t *notmuch)\r
177 > +{\r
178 > +       try {\r
179 > +               notmuch->xapian_db->reopen ();\r
180 > +       } catch (const Xapian::Error &error) {\r
181 > +               if (! notmuch->exception_reported) {\r
182 > +               fprintf (stderr, "Error: A Xapian exception occurred reopening database: %s\n",\r
183 > +               error.get_msg().c_str());\r
184 > +               }\r
185 > +       }\r
186 > +}\r
187 > +\r
188 > +void\r
189 > +notmuch_database_flush (notmuch_database_t *notmuch)\r
190 >  {\r
191 >      try {\r
192 >         if (notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE)\r
193 > -           (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();\r
194 > +               (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();\r
195 >      } catch (const Xapian::Error &error) {\r
196 > -       if (! notmuch->exception_reported) {\r
197 > -           fprintf (stderr, "Error: A Xapian exception occurred flushing database: %s\n",\r
198 > -                    error.get_msg().c_str());\r
199 > +               if (! notmuch->exception_reported) {\r
200 > +               fprintf (stderr, "Error: A Xapian exception occurred flushing database: %s\n",\r
201 > +               error.get_msg().c_str());\r
202 > +               }\r
203 >         }\r
204 > -    }\r
205 > +}\r
206 \r
207 Both catch blocks should set notmuch->exception_reported = TRUE;\r
208 (notmuch_database_close happens to be the one exception to this since\r
209 it's closing the database; see other catch blocks in lib/database.cc).\r
210 \r
211 The catch block in notmuch_database_flush shouldn't appear as changed\r
212 in the diff; you should leave the spacing the way it originally was.\r