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