Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / c1 / 2f4d4db3c625d39e1833ba498586b85196af35
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 56218431FB6\r
6         for <notmuch@notmuchmail.org>; Sat, 23 Aug 2014 15:21:25 -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 Tp059WRUnxwx for <notmuch@notmuchmail.org>;\r
16         Sat, 23 Aug 2014 15:21:18 -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 3EA37431FAF\r
21         for <notmuch@notmuchmail.org>; Sat, 23 Aug 2014 15:21:18 -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 1XLJgP-0002Jr-3V; Sat, 23 Aug 2014 19:21:13 -0300\r
25 Received: (nullmailer pid 18176 invoked by uid 1000); Sat, 23 Aug 2014\r
26         22:21:07 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
29 Subject: Re: [PATCH v3 04/13] lib: Database version 3: Introduce fine-grained\r
30         "features"\r
31 In-Reply-To: <1406859003-11561-5-git-send-email-amdragon@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 User-Agent: Notmuch/0.18.1+72~g028c560 (http://notmuchmail.org) Emacs/24.3.1\r
35         (x86_64-pc-linux-gnu)\r
36 Date: Sat, 23 Aug 2014 15:21:07 -0700\r
37 Message-ID: <87ppfqsv8s.fsf@maritornes.cs.unb.ca>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain\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, 23 Aug 2014 22:21:25 -0000\r
53 \r
54 Austin Clements <amdragon@MIT.EDU> writes:\r
55 >  \r
56 > +    /* Bit mask of features used by this database.  Features are\r
57 > +     * named, independent aspects of the database schema.  This is a\r
58 > +     * bitwise-OR of NOTMUCH_FEATURE_* values (below). */\r
59 > +    unsigned int features;\r
60 \r
61 Should we be using a fixed size integer (uint_32t or whatever) for\r
62 features? iirc the metadata in the database is actually a string, so I\r
63 guess arbitrary precision there.\r
64 \r
65 > +/* Bit masks for _notmuch_database::features. */\r
66 > +enum {\r
67 > +    /* If set, file names are stored in "file-direntry" terms.  If\r
68 > +     * unset, file names are stored in document data.\r
69 > +     *\r
70 > +     * Introduced: version 1.  Implementation support: both for read;\r
71 > +     * required for write. */\r
72 > +    NOTMUCH_FEATURE_FILE_TERMS = 1 << 0,\r
73 \r
74 I agree with Jani that the Implementation support: part is a bit\r
75 mystifying without the commit message. Maybe part of the commit message\r
76 could migrate here? Or maybe just add a pointer to the comment in database.cc.\r
77 \r
78 > +             if (! *incompat_out)\r
79 \r
80 Should we support passing NULL for incompat_out? or at least check for\r
81 it?\r
82 \r
83 > @@ -1048,7 +1164,8 @@ notmuch_database_get_version (notmuch_database_t *notmuch)\r
84 >  notmuch_bool_t\r
85 >  notmuch_database_needs_upgrade (notmuch_database_t *notmuch)\r
86 >  {\r
87 > -    return notmuch->needs_upgrade;\r
88 > +    return notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE &&\r
89 > +     (NOTMUCH_FEATURES_CURRENT & ~notmuch->features);\r
90 >  }\r
91 \r
92 Maybe I'm not thinking hard enough here, but how does this deal with a\r
93 feature that is needed to open a database in read only mode? Maybe it\r
94 needs a comment for people not as clever as Austin ;).\r
95 \r
96 d\r
97 \r