[PATCH] lib: reword comment about XFOLDER: prefix
authorDavid Bremner <david@tethera.net>
Thu, 18 Aug 2016 08:18:31 +0000 (05:18 +2100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:27 +0000 (16:22 -0700)
b3/2d7e98b4d4bfcf02515985e48f003848cc6720 [new file with mode: 0644]

diff --git a/b3/2d7e98b4d4bfcf02515985e48f003848cc6720 b/b3/2d7e98b4d4bfcf02515985e48f003848cc6720
new file mode 100644 (file)
index 0000000..fd1e0c7
--- /dev/null
@@ -0,0 +1,83 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 56B7F6DE0A63\r
+ for <notmuch@notmuchmail.org>; Thu, 18 Aug 2016 01:18:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.007\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=0.004,\r
+  SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 3sl36DzodAo4 for <notmuch@notmuchmail.org>;\r
+ Thu, 18 Aug 2016 01:18:48 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id BA15E6DE0A40\r
+ for <notmuch@notmuchmail.org>; Thu, 18 Aug 2016 01:18:48 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1baIXT-0005MZ-G3; Thu, 18 Aug 2016 04:18:59 -0400\r
+Received: (nullmailer pid 21850 invoked by uid 1000);\r
+ Thu, 18 Aug 2016 08:18:46 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: David Bremner <david@tethera.net>, Jani Nikula <jani@nikula.org>,\r
+ notmuch@notmuchmail.org\r
+Subject: [PATCH] lib: reword comment about XFOLDER: prefix\r
+Date: Thu, 18 Aug 2016 05:18:31 -0300\r
+Message-Id: <1471508311-21806-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.8.1\r
+In-Reply-To: <1471508096-19252-1-git-send-email-david@tethera.net>\r
+References: <1471508096-19252-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.22\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 18 Aug 2016 08:18:49 -0000\r
+\r
+I believe the current one is misleading, because in my experiments\r
+Xapian did not add : when prefix and term were both upper case. Indeed,\r
+it's hard to see how it could, because prefixes are added at a layer\r
+above Xapian in our code. See _notmuch_message_add_term for an example.\r
+\r
+Also try to explain why this is a good idea.  As far as I can ascertain,\r
+this is more of an issue for a system trying to work with an unknown set\r
+of prefixes. Since notmuch has a fixed set of prefixes, and we can\r
+hopefully be trusted not to add XGOLD and XGOLDEN as prefixes, it is\r
+harder for problems to arise.\r
+---\r
+ lib/database.cc | 8 ++++----\r
+ 1 file changed, 4 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index 57a98c9..5577aaf 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -260,10 +260,10 @@ static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {\r
+     { "id",                   "Q" },\r
+     { "path",                 "P" },\r
+     /*\r
+-     * Without the ":", since this is a multi-letter prefix, Xapian\r
+-     * will add a colon itself if the first letter of the path is\r
+-     * upper-case ASCII. Including the ":" forces there to always be a\r
+-     * colon, which keeps our own logic simpler.\r
++     * Unconditionally add ':' to reduce potential ambiguity with\r
++     * overlapping prefixes and/or terms that start with capital\r
++     * letters. See Xapian document termprefixes.html for related\r
++     * discussion.\r
+      */\r
+     { "folder",                       "XFOLDER:" },\r
+ };\r
+-- \r
+2.8.1\r
+\r