From: David Bremner Date: Fri, 7 Aug 2015 20:38:49 +0000 (+0200) Subject: Re: [PATCH 2/6] lib: Add per-message last modification tracking X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e38bd9d83a32f687de5c8bea2911a1c5f6d4181;p=notmuch-archives.git Re: [PATCH 2/6] lib: Add per-message last modification tracking --- diff --git a/c3/39623974366d0195f883a5bea611c405408b4c b/c3/39623974366d0195f883a5bea611c405408b4c new file mode 100644 index 000000000..301f88635 --- /dev/null +++ b/c3/39623974366d0195f883a5bea611c405408b4c @@ -0,0 +1,85 @@ +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 44EB06DE1635 + for ; Fri, 7 Aug 2015 13:41:30 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.137 +X-Spam-Level: +X-Spam-Status: No, score=0.137 tagged_above=-999 required=5 tests=[AWL=0.137] + 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 g2--L4RalH46 for ; + Fri, 7 Aug 2015 13:41:28 -0700 (PDT) +Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 9E29F6DE1648 + for ; Fri, 7 Aug 2015 13:41:27 -0700 (PDT) +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from ) + id 1ZNoPw-0007LI-81; Fri, 07 Aug 2015 20:39:04 +0000 +Received: (nullmailer pid 2725 invoked by uid 1000); Fri, 07 Aug 2015 + 20:38:49 -0000 +From: David Bremner +To: Daniel Schoepe , notmuch@notmuchmail.org +Subject: Re: [PATCH 2/6] lib: Add per-message last modification tracking +In-Reply-To: <878u9nk0st.fsf@schoepe.localhost> +References: <1432936375-astroid-4-0i1n6yczs2-1520@strange> + <1433525318-23756-1-git-send-email-david@tethera.net> + <1433525318-23756-3-git-send-email-david@tethera.net> + <878u9nk0st.fsf@schoepe.localhost> +User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Fri, 07 Aug 2015 22:38:49 +0200 +Message-ID: <87r3ne96li.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain +Cc: Austin Clements +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Fri, 07 Aug 2015 20:41:30 -0000 + +Daniel Schoepe writes: + + +> On Fri, 05 Jun 2015 19:28 +0200, David Bremner wrote: +>> + /* Prior to NOTMUCH_FEATURE_LAST_MOD, messages did not +>> + * track modification revisions. Give all messages a +>> + * revision of 1. +>> + */ +>> + if (new_features & NOTMUCH_FEATURE_LAST_MOD) +>> + _notmuch_message_upgrade_last_mod (message); +>> [..] +>> +/* Upgrade a message to support NOTMUCH_FEATURE_LAST_MOD. The caller +>> + * must call _notmuch_message_sync. */ +>> +void +>> +_notmuch_message_upgrade_last_mod (notmuch_message_t *message) +>> +{ +>> + /* _notmuch_message_sync will update the last modification +>> + * revision; we just have to ask it to. */ +>> + message->modified = TRUE; +>> +} +>> + +> +> The comment in the first part says that message without LAST_MOD get a +> revision of 1, but as far as I can tell, _notmuch_message_sync will +> actually put the next revision number on the message. If this is what's +> happening, either the comment or the behavior should be changed, +> depending on what's intended. + +I think the behaviour is OK, but you're correct the comment is +wrong. I'll see if Austin has any comment on that. I guess it would be +harmless to initialize upgraded messages to some low revision number, +but I don't see the benefit.