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