Re: Applying patches directly from emails?
[notmuch-archives.git] / 0a / 887c12d0f7b00c96ab8dfa41e7420084e16d51
1 Return-Path: <david@tethera.net>\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 14548431FB6\r
6         for <notmuch@notmuchmail.org>; Sun, 24 Aug 2014 16:03:33 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 5lcIJk2kWzhW for <notmuch@notmuchmail.org>;\r
16         Sun, 24 Aug 2014 16:03:29 -0700 (PDT)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 37412431FAE\r
21         for <notmuch@notmuchmail.org>; Sun, 24 Aug 2014 16:03:29 -0700 (PDT)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <david@tethera.net>)\r
24         id 1XLgoq-0007Al-1X; Sun, 24 Aug 2014 20:03:28 -0300\r
25 Received: (nullmailer pid 5134 invoked by uid 1000); Sun, 24 Aug 2014\r
26         23:03:23 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: Austin Clements <amdragon@mit.edu>\r
29 Subject: Re: [PATCH v3 04/13] lib: Database version 3: Introduce fine-grained\r
30         "features"\r
31 In-Reply-To: <20140824221629.GP3015@mit.edu>\r
32 References: <1406859003-11561-1-git-send-email-amdragon@mit.edu>\r
33         <1406859003-11561-5-git-send-email-amdragon@mit.edu>\r
34         <87ppfqsv8s.fsf@maritornes.cs.unb.ca>\r
35         <87fvgmg0tx.fsf@awakening.csail.mit.edu>\r
36         <87zjeu4jyp.fsf@maritornes.cs.unb.ca> <20140824221629.GP3015@mit.edu>\r
37 User-Agent: Notmuch/0.18.1+72~g028c560 (http://notmuchmail.org) Emacs/24.3.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Sun, 24 Aug 2014 16:03:23 -0700\r
40 Message-ID: <871ts5mqx0.fsf@maritornes.cs.unb.ca>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain\r
43 Cc: notmuch@notmuchmail.org\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Sun, 24 Aug 2014 23:03:33 -0000\r
57 \r
58 Austin Clements <amdragon@mit.edu> writes:\r
59 \r
60 > Quoth David Bremner on Aug 23 at  8:58 pm:\r
61 >> Austin Clements <amdragon@mit.edu> writes:\r
62 >> \r
63 >> >>> @@ -1048,7 +1164,8 @@ notmuch_database_get_version (notmuch_database_t *notmuch)\r
64 >> >>>  notmuch_bool_t\r
65 >> >>>  notmuch_database_needs_upgrade (notmuch_database_t *notmuch)\r
66 >> >>>  {\r
67 >> >>> -    return notmuch->needs_upgrade;\r
68 >> >>> +    return notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE &&\r
69 >> >>> +        (NOTMUCH_FEATURES_CURRENT & ~notmuch->features);\r
70 >> >>>  }\r
71 >> >>\r
72 >> >> Maybe I'm not thinking hard enough here, but how does this deal with a\r
73 >> >> feature that is needed to open a database in read only mode? Maybe it\r
74 >> >> needs a comment for people not as clever as Austin ;).\r
75 >> >\r
76 >> > I'm not quite sure what you mean.  notmuch_database_needs_upgrade\r
77 >> > returns false for read-only databases because you can't upgrade a\r
78 >> > read-only database.  This was true before this patch, too, though it was\r
79 >> > less obvious.  (Maybe that's not what you're asking?)\r
80 >> \r
81 >> Yes, that's what I was asking. I guess it's orthogonal to your patch\r
82 >> series, but the logic of returning FALSE for read only databases is not\r
83 >> very intuitive to me (in the sense that "needs upgrade" is not the\r
84 >> opposite of "can't be upgraded".  Your new comment later in the series\r
85 >> is better, but it would IMHO be even better if you mentioned the read\r
86 >> only case.\r
87 >\r
88 > That's a good point.  Ideally this should be\r
89 > "notmuch_database_can_upgrade" or something, which I think would\r
90 > capture exactly what it means after this series.  However, I don't\r
91 > think it's worth breaking API compatibility given that this is already\r
92 > how callers use this function (even though that violates the current\r
93 > library spec).\r
94 >\r
95 > So, how's this for a more updated doc comment on needs_upgrade?\r
96 \r
97 LGTM\r