Re: [notmuch] [PATCHv2] Preserve folder information when indexing
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 2 Feb 2010 20:43:27 +0000 (21:43 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:05 +0000 (09:36 -0800)
56/2a3c53a82ca4b4b79964cb258234201800ecbf [new file with mode: 0644]

diff --git a/56/2a3c53a82ca4b4b79964cb258234201800ecbf b/56/2a3c53a82ca4b4b79964cb258234201800ecbf
new file mode 100644 (file)
index 0000000..7cd4c3f
--- /dev/null
@@ -0,0 +1,110 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 77857431FBD\r
+       for <notmuch@notmuchmail.org>; Tue,  2 Feb 2010 12:43:36 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.779\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.779 tagged_above=-999 required=5\r
+       tests=[AWL=-0.780, BAYES_50=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id QzSKkujS3pjg for <notmuch@notmuchmail.org>;\r
+       Tue,  2 Feb 2010 12:43:33 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id B08D5431FAE\r
+       for <notmuch@notmuchmail.org>; Tue,  2 Feb 2010 12:43:33 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id E8D8F19F3396;\r
+       Tue,  2 Feb 2010 21:43:32 +0100 (CET)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id meMVX-8uwkWy; Tue,  2 Feb 2010 21:43:28 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id C591B19F32FF;\r
+       Tue,  2 Feb 2010 21:43:28 +0100 (CET)\r
+Received: from wsheee.localnet (unknown [213.29.198.144])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id B8B6515C052;\r
+       Tue,  2 Feb 2010 21:43:28 +0100 (CET)\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Arvid Picciani <aep@exys.org>\r
+Date: Tue, 2 Feb 2010 21:43:27 +0100\r
+User-Agent: KMail/1.12.2 (Linux/2.6.31.9; KDE/4.3.2; i686; ; )\r
+References: <201001291049.21048.sojkam1@fel.cvut.cz>\r
+       <87eil3ehjh.fsf@servo.finestructure.net>\r
+       <4B686569.7030408@exys.org>\r
+In-Reply-To: <4B686569.7030408@exys.org>\r
+MIME-Version: 1.0\r
+Content-Type: Text/Plain;\r
+  charset="utf-8"\r
+Content-Transfer-Encoding: 7bit\r
+Message-Id: <201002022143.27708.sojkam1@fel.cvut.cz>\r
+Cc: notmuch@notmuchmail.org\r
+Subject: Re: [notmuch] [PATCHv2] Preserve folder information when indexing\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 02 Feb 2010 20:43:36 -0000\r
+\r
+On Tuesday 02 February 2010 18:48:25 Arvid Picciani wrote:\r
+> On Tue,  2 Feb 2010 16:01:08 +0100, Michal Sojka<sojkam1@fel.cvut.cz>\r
+> \r
+> wrote:\r
+> > Stores the folder (directory name) of the message in the database as a\r
+> > term with folder prefix.\r
+\r
+Hi,\r
+\r
+I've just made several experiments. I tested both Maildir layout (your case)\r
+and non-Maildir layout and both layouts work correctly.\r
+\r
+Then I tried to create notmuch database without this patch and then add new mails\r
+and run notmuch new with the patch. It seems that in that case no folder terms\r
+are added to the database. \r
+\r
+Probably DATABASE_VERSION should be increased by this patch, but I do not want\r
+to do it until it is clear that this patch will be merged. Otherwise, there \r
+might be collision with other patches.\r
+> \r
+> unfortunately it doesnt do anything here :/\r
+> i rebuilt the entire index, but no folder: field is added.\r
+\r
+How did you rebuild it? I deleted the .notmuch directory and run notmuch new.\r
+\r
+> can anyone who got it working tell me their directory layout?\r
+> mine would be something like:\r
+\r
+If the above didn't help, try to apply this patch. If you see your folder names\r
+during notmuch new, it should work.\r
+\r
+Michal\r
+\r
+---- 8< ------\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index ba2aa16..a22e226 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -1436,6 +1436,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
+            date = notmuch_message_file_get_header (message_file, "date");\r
+            _notmuch_message_set_date (message, date);\r
\r
++           printf("folder=%s\n", folder_name);\r
+            if (folder_name != NULL)\r
+                _notmuch_message_gen_terms (message, "folder", folder_name);\r
\r
+\r