1 Return-Path: <adrien@bustany.org>
\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 16FBA431FBD
\r
6 for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 14:34:14 -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 tests=[none]
\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 kqvlYETZrCaa for <notmuch@notmuchmail.org>;
\r
16 Wed, 17 Oct 2012 14:34:13 -0700 (PDT)
\r
17 Received: from mail.bustany.org (bustany.org [176.31.244.208])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 82C0A431FB6
\r
19 for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 14:34:13 -0700 (PDT)
\r
20 Received: from [192.168.1.147] (91-158-5-86.elisa-laajakaista.fi
\r
21 [91.158.5.86]) by mail.bustany.org (Postfix) with ESMTPSA id 3C8761401ED;
\r
22 Wed, 17 Oct 2012 23:37:59 +0200 (CEST)
\r
23 Message-ID: <507F2450.5020005@bustany.org>
\r
24 Date: Thu, 18 Oct 2012 00:34:08 +0300
\r
25 From: Adrien Bustany <adrien@bustany.org>
\r
26 User-Agent: Mozilla/5.0 (X11; Linux x86_64;
\r
27 rv:16.0) Gecko/20121009 Thunderbird/16.0
\r
29 To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>
\r
30 Subject: Re: [PATCH 1/2] Add notmuch_database_flush method
\r
31 References: <1342723401-26103-1-git-send-email-adrien@bustany.org>
\r
32 <1342723401-26103-2-git-send-email-adrien@bustany.org>
\r
33 <87d30h857w.fsf@betacantrips.com>
\r
34 In-Reply-To: <87d30h857w.fsf@betacantrips.com>
\r
35 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
\r
36 Content-Transfer-Encoding: 8bit
\r
37 Cc: notmuch@notmuchmail.org
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Wed, 17 Oct 2012 21:34:14 -0000
\r
52 Le 17/10/2012 18:53, Ethan Glasser-Camp a écrit :
\r
53 > Adrien Bustany <adrien@bustany.org> writes:
\r
55 >> This method explicitly flushes the pending modifications to disk. It is
\r
56 >> useful if your program has various threads, each with a read only DB and
\r
57 >> one writer thread with a read/write DB. In that case, you most likely
\r
58 >> want the writer to sync the changes to disk so that the readers can see
\r
59 >> them, without having to close and reopen the database completely.
\r
61 > These patches are pretty straightforward. But to conform to notmuch style..
\r
63 >> +notmuch_status_t
\r
64 >> +notmuch_database_flush(notmuch_database_t *notmuch)
\r
66 >> + notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
\r
68 > Indent is 4 spaces. (You have tabs here, which are 8 spaces, according
\r
72 >> + if (notmuch->xapian_db != NULL &&
\r
74 > if should be more indented than try. (So when you pull try back to 4
\r
75 > spaces, leave if at 8 spaces.)
\r
77 Sorry about that... I think I copied the style from
\r
78 notmuch_database_close, but my editor was set to have 4-space tabs, so I
\r
79 got confused. I'll send a fixed version of the patches.
\r
82 >> + notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE)
\r
83 >> + (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();
\r
85 > This line is 90 characters, and will remain at 86 once you indent using
\r
86 > the in-house style. I'm not sure if it's worth reformatting.
\r
87 > notmuch_database_close calls flush() using exactly the same 86-character
\r
88 > line. I'd say "don't make it worse", but personally I think breaking
\r
89 > this line might be worse.
\r
92 Yes, I also think breaking this line will not make things prettier :-/
\r
97 Thanks for the review!
\r