Re: [PATCH v3 15/16] added notmuch_message_reindex
authorDavid Bremner <david@tethera.net>
Sun, 28 Feb 2016 14:52:03 +0000 (10:52 +2000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:12 +0000 (16:21 -0700)
a7/07121b9c97ac0e4c5e3e92f4a87f9bef538720 [new file with mode: 0644]

diff --git a/a7/07121b9c97ac0e4c5e3e92f4a87f9bef538720 b/a7/07121b9c97ac0e4c5e3e92f4a87f9bef538720
new file mode 100644 (file)
index 0000000..49cdd78
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <david@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 B88A16DE13DB\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:52:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.035\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.035 tagged_above=-999 required=5\r
+ tests=[AWL=-0.024, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]\r
+ 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 s6wxwgGg5hMw for <notmuch@notmuchmail.org>;\r
+ Sun, 28 Feb 2016 06:52:05 -0800 (PST)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 19B5E6DE13D2\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:52:05 -0800 (PST)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1aa2iC-0008KI-E9; Sun, 28 Feb 2016 09:52:44 -0500\r
+Received: (nullmailer pid 32575 invoked by uid 1000);\r
+ Sun, 28 Feb 2016 14:52:03 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v3 15/16] added notmuch_message_reindex\r
+In-Reply-To: <1454272801-23623-16-git-send-email-dkg@fifthhorseman.net>\r
+References: <1454272801-23623-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1454272801-23623-16-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.21+26~g9404723 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 28 Feb 2016 10:52:03 -0400\r
+Message-ID: <87k2lo51m4.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\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: Sun, 28 Feb 2016 14:52:06 -0000\r
+\r
+Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+\r
+> +    const char *autotags[] = {\r
+> +                "attachment",\r
+> +                "encrypted",\r
+> +                "signed",\r
+> +                "index-decrypted",\r
+> +                "index-decryption-failed" };\r
+\r
+Hmm. Is this really the only place these values are needed? That's a bit\r
+surprising to me.\r
+\r
+> +    /* cache tags and filenames */\r
+> +    tags = notmuch_message_get_tags(message);\r
+> +    filenames = notmuch_message_get_filenames(message);\r
+> +    orig_filenames = notmuch_message_get_filenames(message);\r
+> +    \r
+> +    /* walk through filenames, removing them until the message is gone */\r
+> +    for ( ; notmuch_filenames_valid (filenames);\r
+> +      notmuch_filenames_move_to_next (filenames)) {\r
+> +    filename = notmuch_filenames_get (filenames);\r
+\r
+What's the expected lifetime of the tags, filenames, and orig_filenames\r
+lists? I guess they live until message dies. Are we expecting message to\r
+die fairly quickly in the usual case?\r
+\r
+> +    \r
+> +    /* re-add the filenames with the associated indexopts */\r
+> +    for (; notmuch_filenames_valid (orig_filenames);\r
+> +     notmuch_filenames_move_to_next (orig_filenames)) {\r
+> +    filename = notmuch_filenames_get (orig_filenames);\r
+> +\r
+> +    status = notmuch_database_add_message_with_indexopts(notmuch,\r
+> +                                                         filename,\r
+> +                                                         indexopts,\r
+> +                                                         readded ? NULL : &newmsg);\r
+\r
+I guess you thought about this already, but I take it you made an\r
+intentional choice to (attempt to) reindex all the files rather than use\r
+_notmuch_message_add_file_name?\r
+\r
+\r