Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 13402431FD5 for ; Thu, 15 Jan 2015 10:57:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.139 X-Spam-Level: X-Spam-Status: No, score=0.139 tagged_above=-999 required=5 tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_MED=-2.3, UNPARSEABLE_RELAY=0.001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id as-z3XRV9-C7 for ; Thu, 15 Jan 2015 10:57:10 -0800 (PST) Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu [18.9.25.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B69C8431FBC for ; Thu, 15 Jan 2015 10:57:10 -0800 (PST) X-AuditID: 1209190e-f799e6d000000cfe-ff-54b80d8572fd Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 6D.D3.03326.58D08B45; Thu, 15 Jan 2015 13:57:09 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id t0FIv9rL028821; Thu, 15 Jan 2015 13:57:09 -0500 Received: from [100.110.13.240] ([216.239.55.240]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) 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 Date: Thu, 15 Jan 2015 13:57:03 -0500 To: Jani Nikula , Todd , 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2015 18:57:14 -0000 Just one nit. Otherwise this patch LGTM. On January 15, 2015 12:20:08 PM EST, Jani Nikula wrote: > >Austin, would you mind having a look at this one please? > >Thanks, >Jani. > >On Wed, 14 Jan 2015, Todd 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