From: Austin Clements Date: Fri, 24 Jan 2014 21:17:58 +0000 (+1900) Subject: Re: [PATCH 0/5] lib: make folder: prefix literal X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=608704e373187138b2c049e893e4ec95fe4034b9;p=notmuch-archives.git Re: [PATCH 0/5] lib: make folder: prefix literal --- diff --git a/7e/52ab6a225e0089d2cf5e43999257c26b186920 b/7e/52ab6a225e0089d2cf5e43999257c26b186920 new file mode 100644 index 000000000..ccb4df6d8 --- /dev/null +++ b/7e/52ab6a225e0089d2cf5e43999257c26b186920 @@ -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 0F83E431FB6 + for ; Fri, 24 Jan 2014 13:18:13 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 lpKb6JWMZJB3 for ; + Fri, 24 Jan 2014 13:18:04 -0800 (PST) +Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu + [18.7.68.34]) + by olra.theworths.org (Postfix) with ESMTP id 2A2E1431FC0 + for ; Fri, 24 Jan 2014 13:18:04 -0800 (PST) +X-AuditID: 12074422-f79526d000000c47-ed-52e2d88b1ddf +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP + id 99.0F.03143.B88D2E25; Fri, 24 Jan 2014 16:18:03 -0500 (EST) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s0OLI2eT026233; + Fri, 24 Jan 2014 16:18:03 -0500 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s0OLHx5F020179 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Fri, 24 Jan 2014 16:18:01 -0500 +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1W6o8V-0006Dc-9F; Fri, 24 Jan 2014 16:17:59 -0500 +From: Austin Clements +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 0/5] lib: make folder: prefix literal +In-Reply-To: +References: +User-Agent: Notmuch/0.17~rc2+14~g06f47e0 (http://notmuchmail.org) Emacs/23.4.1 + (i486-pc-linux-gnu) +Date: Fri, 24 Jan 2014 16:17:58 -0500 +Message-ID: <87y525m649.fsf@awakening.csail.mit.edu> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFrrPIsWRmVeSWpSXmKPExsUixCmqrdt941GQwbz9yhZN050trt+cyezA + 5HHr/mt2j2erbjEHMEVx2aSk5mSWpRbp2yVwZbT17mEuuCxZMXmCSwPjMeEuRk4OCQETif4n + D1ghbDGJC/fWs3UxcnEICcxmkjj7awMLhLORUaJt3i1GCOc0k8Sk+bOhMksYJXafbAXrZxPQ + l1ixdhKYLSJgJXHu4WsWEFtYwFJi6p0pTCA2p4CxxJ7dixhBbCEBI4nTd9rZQGxRgSSJ01N/ + A/VycLAIqEpcm1oCEuYFOu9f50IWCFtQ4uTMJ2A2s4CWxI1/L5kmMArMQpKahSS1gJFpFaNs + Sm6Vbm5iZk5xarJucXJiXl5qka6pXm5miV5qSukmRlA4srso7WD8eVDpEKMAB6MSD++MwIdB + QqyJZcWVuYcYJTmYlER5p15+FCTEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhHfuZqAcb0piZVVq + UT5MSpqDRUmc9xaHfZCQQHpiSWp2ampBahFMVoaDQ0mCV/86UKNgUWp6akVaZk4JQpqJgxNk + OA/QcBeQGt7igsTc4sx0iPwpRkUpcd4F14ASAiCJjNI8uF5YunjFKA70ijCvIUg7DzDVwHW/ + AhrMBDR4xdkHIINLEhFSUg2M868w2IXwvk507MlY2XY2d0/NjFfBvPY2t1NOex+q2rzx1rVK + 0UMLVBjaI/Vu3/3dernow9f/CcUM6vwHpq+4JK14Uzx53bc72gFvnwrL3eX0z9/vVM+gkG32 + 0XPLt8eRzVvFNy3Yu2py0NkDxhF9H7b9ujND9a/fxdZA5QtL7CcGhvb2mj4+rMRSnJFoqMVc + VJwIAKmjcxDyAgAA +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: Fri, 24 Jan 2014 21:18:13 -0000 + +On Thu, 09 Jan 2014, Jani Nikula wrote: +> Hi all, this series makes the folder: search prefix literal, or switches +> it from a probabilistic prefix to a boolean prefix. With this, you have +> to give the path from the maildir root to the folder you want in full, +> including the maildir cur/new component, if any. Examples: + +I strongly disagree with requiring the cur/new component. The cur/new +directory is an internal implementation detail of Maildir (and a rather +broken one at that) and no more a part of the "folder" of a piece of +mail than its final file name component. It's also the less obvious +user interface; if we require the cur/new component, we *will* get +people asking why their folder searches aren't working, but if we strip +the cur/new component, nobody will be surprised. + +I think the question is not whether we should strip cur/new, but when. +We've already defined a "_filename_is_in_maildir" test in +lib/message.cc, which we depend on for flag sync. It's simple, but I +think this would be the right thing to use for consistency. + +> folder:cur +> folder:foo/bar +> folder:"" +> +> The last one can be used to refer to the maildir root (note that in +> shell you'll need quoting to pass the double quotes to xapian, +> folder:'""'). +> +> The old probabilistic folder: prefix is problematic in a number of +> ways. It's not possible to refer to the maildir root. It does stemming, +> so "inboxing" would match "inbox" too. "cur" for the folder in maildir +> root would match all "cur" folders across the maildir hierarchy. Likely +> some others I forgot. +> +> WARNING! The change requires a database format version bump, and a +> database upgrade, which is automatically done on 'notmuch new'. The +> upgrade is irreversible if you want to try this on your database! A +> complete database rebuild is required for reverting the database format +> version. Make sure your backups are in order! +> +> The series includes some tests, including an initial upgrade test, along +> with a test database in the previous format version. +> +> +> BR, +> Jani. +> +> +> +> Jani Nikula (5): +> lib: make folder: prefix literal +> test: fix insert folder: searches +> test: fix test for literal folder: search +> test: add test database in format version 1 +> test: add database upgrade test from format version 1 +> +> lib/database.cc | 39 ++++++++- +> lib/message.cc | 154 +++++++++++++++++---------------- +> lib/notmuch-private.h | 3 + +> test/insert | 10 +-- +> test/notmuch-test | 1 + +> test/search-by-folder | 24 ++++- +> test/test-databases/README | 5 ++ +> test/test-databases/database-v1.tar.gz | Bin 0 -> 252243 bytes +> test/upgrade | 25 ++++++ +> 9 files changed, 174 insertions(+), 87 deletions(-) +> create mode 100644 test/test-databases/README +> create mode 100644 test/test-databases/database-v1.tar.gz +> create mode 100755 test/upgrade +> +> -- +> 1.8.5.2 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch