Re: [PATCH v2 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES database feature

Subject: Re: [PATCH v2 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES database feature

Date: Thu, 15 Jan 2015 13:57:03 -0500

To: Jani Nikula, Todd, notmuch@notmuchmail.org

Cc:

From: Austin Clements


by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id t0FIv6hP028082
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 15 Jan 2015 13:57:07 -0500
User-Agent: K-9 Mail for Android
In-Reply-To: <87y4p47ygn.fsf@nikula.org>
References: <1421193628-2699-1-git-send-email-todd@electricoding.com>
	<1421193628-2699-3-git-send-email-todd@electricoding.com>
	<87y4p47ygn.fsf@nikula.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain;
 charset=UTF-8
Subject: Re: [PATCH v2 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES
	database	feature
From: Austin Clements <aclements@csail.mit.edu>
Date: Thu, 15 Jan 2015 13:57:03 -0500
To: Jani Nikula <jani@nikula.org>, Todd <todd@electricoding.com>,
	notmuch@notmuchmail.org
Message-ID: <9ECDA9FC-AC29-48D0-A50B-F8B274E9A16C@csail.mit.edu>
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCKsWRmVeSWpSXmKPExsUixG6notvKuyPEYM0jK4um6c4W12/OZLZo
	3bqAyYHZ437vF2aPW/dfs3s8W3WLOYA5issmJTUnsyy1SN8ugSvj0sPbbAXfpCpmTrrI3sDY
	J9rFyMkhIWAicWHCajYIW0ziwr31QDYXh5DAYiaJhkermSGcjYwS91Z+YIRymCRWbrzNBNIi
	KqAgMW/yREYQm1NAQ2Lt/DUsEEWzGSXefX3PApLgFRCUODnzCZjNLCAv0bx1NjOErSlx7fgW
	dhBbWCBM4sOHK2BxNgF9iRVrJ7GC2CwCqhIz158D6uXgEBFIktjxE2qkg8TK/y/YJzAKzEKy
	YRaSDbOQbFjAyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI11gvN7NELzWldBMjKHg5Jfl2MH49
	qHSIUYCDUYmHl8Fve4gQa2JZcWXuIUZJDiYlUd6wz0AhvqT8lMqMxOKM+KLSnNTiQ4wSHMxK
	Iry8zDtChHhTEiurUovyYVLSHCxK4rybfvCFCAmkJ5akZqemFqQWwWQ1ODgEDpyZO51JiiUv
	Py9VSYI3lQdoiGBRanpqRVpmTglCKRMHJ8giHqBFO0BqeIsLEnOLM9Mh8qcYjTkmPNg1k4lj
	2okDM5mEwMZJifM+BCkVACnNKM2DmwZLTK8YxYEeFeY9CFLFA0xqcPNeAa1iAlrVkLQVZFVJ
	IkJKqoGxiJPl926+fo2Xfd2Cs/g5ON4knvWevXyy7YZqZwHLz1J3EnNOrfkd8DShvljeIXze
	vZ7pVRuYYz9b/DWOYOPfaanTFjF3kdmd6zM3u0Sv38Z3PaB4z7fNexzuyPCkW7cbZShcTr4l
	unv3nJzeuS9v8DOfcLu1pPSuvHqz4bIZP7k+BC2OzlurxFKckWioxVxUnAgA/zMYeycDAAA=
X-BeenThere: notmuch@notmuchmail.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "Use and development of the notmuch mail system."
	<notmuch.notmuchmail.org>
List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
	<mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
List-Archive: <http://notmuchmail.org/pipermail/notmuch>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
	<mailto:notmuch-request@notmuchmail.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Jan 2015 18:57:14 -0000
Status: O
Content-Length: 3352
Lines: 94

Just one nit. Otherwise this patch LGTM.

On January 15, 2015 12:20:08 PM EST, Jani Nikula <jani@nikula.org> wrote:
>
>Austin, would you mind having a look at this one please?
>
>Thanks,
>Jani.
>
>On Wed, 14 Jan 2015, Todd <todd@electricoding.com> wrote:
>> ---
>>  lib/database-private.h | 15 ++++++++++++---
>>  lib/database.cc        | 10 ++++++++--
>>  2 files changed, 20 insertions(+), 5 deletions(-)
>>
>> diff --git a/lib/database-private.h b/lib/database-private.h
>> index 15e03cc..6d6fa2c 100644
>> --- a/lib/database-private.h
>> +++ b/lib/database-private.h
>> @@ -92,6 +92,14 @@ enum _notmuch_features {
>>       *
>>       * Introduced: version 3. */
>>      NOTMUCH_FEATURE_GHOSTS = 1 << 4,
>> +
>> +
>> +    /* If set, then the database was created after the introduction
>of
>> +     * indexed mime types. If unset, then the database may contain a
>> +     * mixture of messages with indexed and non-indexed mime types.
>> +     *
>> +     * Introduced: version 3. */
>> +    NOTMUCH_FEATURE_INDEXED_MIMETYPES = 1 << 5,
>>  };
>>  
>>  /* In C++, a named enum is its own type, so define bitwise operators
>> @@ -161,9 +169,10 @@ struct _notmuch_database {
>>  
>>  /* Current database features.  If any of these are missing from a
>>   * database, request an upgrade.
>> - * NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES is not included because
>> - * upgrade doesn't currently introduce the feature (though brand new
>> - * databases will have it). */
>> + * NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES and
>> + * NOTMUCH_FEATURE_INDEXED_MIMETYPES are not included because
>upgrade
>> + * doesn't currently introduce the features (though brand new
>databases
>> + * will have it). */
>>  #define NOTMUCH_FEATURES_CURRENT \
>>      (NOTMUCH_FEATURE_FILE_TERMS | NOTMUCH_FEATURE_DIRECTORY_DOCS | \
>>       NOTMUCH_FEATURE_BOOL_FOLDER | NOTMUCH_FEATURE_GHOSTS)
>> diff --git a/lib/database.cc b/lib/database.cc
>> index 3601f9d..2de60f8 100644
>> --- a/lib/database.cc
>> +++ b/lib/database.cc
>> @@ -304,6 +304,11 @@ static const struct {
>>        "exact folder:/path: search", "rw" },
>>      { NOTMUCH_FEATURE_GHOSTS,
>>        "mail documents for missing messages", "w"},
>> +    /* Knowledge of the index mime-types are not required for
>reading
>> +     * a database because a reader will just be unable to query
>> +     * them. */
>> +    { NOTMUCH_FEATURE_INDEXED_MIMETYPES,
>> +      "mime-types in database", "w"},

I would label this "indexed MIME types" to be closer to the enum and because "MIME" is an acronym and hence should be capitalized.

>>  };
>>  
>>  const char *
>> @@ -646,9 +651,10 @@ notmuch_database_create (const char *path,
>notmuch_database_t **database)
>>      if (status)
>>  	goto DONE;
>>  
>> -    /* Upgrade doesn't add this feature to existing databases, but
>new
>> -     * databases have it. */
>> +    /* Upgrade doesn't add these feature to existing databases, but
>> +     * new databases have them. */
>>      notmuch->features |= NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES;
>> +    notmuch->features |= NOTMUCH_FEATURE_INDEXED_MIMETYPES;
>>  
>>      status = notmuch_database_upgrade (notmuch, NULL, NULL);
>>      if (status) {
>> -- 
>> 1.9.1
>>
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


Thread: