From: Jani Nikula Date: Thu, 15 Jan 2015 17:20:08 +0000 (+0200) Subject: Re: [PATCH v2 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES database feature X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a90b8a0ab074444d6190e93a9595b30acb89157b;p=notmuch-archives.git Re: [PATCH v2 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES database feature --- diff --git a/c9/4eef8dd4485337b516dc05a1397460c34655f3 b/c9/4eef8dd4485337b516dc05a1397460c34655f3 new file mode 100644 index 000000000..004295c9c --- /dev/null +++ b/c9/4eef8dd4485337b516dc05a1397460c34655f3 @@ -0,0 +1,153 @@ +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 89D67431FD9 + for ; Thu, 15 Jan 2015 09:20:01 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.738 +X-Spam-Level: * +X-Spam-Status: No, score=1.738 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7] + 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 Jin5SmFeJTix for ; + Thu, 15 Jan 2015 09:19:58 -0800 (PST) +Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com + [74.125.82.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 24C04431FD5 for ; Thu, 15 Jan 2015 09:19:58 -0800 + (PST) +Received: by mail-wg0-f42.google.com with SMTP id k14so16229632wgh.1 + for ; Thu, 15 Jan 2015 09:19:57 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=wzK08QjoKRUVg/bT0rffPTKZCAXfSvGmgOyXTAuYJOs=; + b=jvy7hhnnWakVMLOP8qUMmWGGCYNj+Kb3Q77g1BTxLSm2S+ZQEG0zzA/Y94jxRl1gmE + WpJWqEGNG6ERUnB1jkGv6vF+vSFAYa5WvFzaIqlSa+IG1HVO/ttALW6b+hDNCVuHkqAD + kKuZFzAgq3gR+qPSxnr08vfH0N7dbQ+DBvKFmW41RIURaRE8pxHl5HRHQR0H21E4HhMG + erInMRCZK7R2YneyjXJY0G8j9csLVyfjaIaW5c35bSPxTD21sG3H8OIa1EJ91K62ADrR + 8AepoYm4bFsibBOGklKLGoVn7WK4KLd37l5fdAo4sLUDAhdoIobMLyuoFBYhOhPrMRNa + xZ4Q== +X-Gm-Message-State: + ALoCoQnW41a/nqa87M0pRM3ObMo0lroGy0c9JaAX2ee1Z9GcF8yoC4YTKXSEoOpQW+BBOqHkYJd8 +X-Received: by 10.180.75.199 with SMTP id e7mr63214332wiw.21.1421342396384; + Thu, 15 Jan 2015 09:19:56 -0800 (PST) +Received: from localhost (mobile-internet-bcee14-89.dhcp.inet.fi. + [188.238.20.89]) by mx.google.com with ESMTPSA id + js5sm23546868wid.11.2015.01.15.09.19.55 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 15 Jan 2015 09:19:55 -0800 (PST) +From: Jani Nikula +To: Todd , notmuch@notmuchmail.org, + Austin Clements +Subject: Re: [PATCH v2 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES + database feature +In-Reply-To: <1421193628-2699-3-git-send-email-todd@electricoding.com> +References: <1421193628-2699-1-git-send-email-todd@electricoding.com> + <1421193628-2699-3-git-send-email-todd@electricoding.com> +User-Agent: Notmuch/0.19+19~g9060a1f (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 15 Jan 2015 19:20:08 +0200 +Message-ID: <87y4p47ygn.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +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 17:20:01 -0000 + + +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"}, +> }; +> +> 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