From 7c9ada443b23df2c4107bb80ea4aa6dba67316e2 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Mon, 22 Sep 2014 18:33:51 +0300 Subject: [PATCH] Re: [PATCH] Add configurable changed tag to messages that have been changed on disk --- 44/53f1f4a03d19a5450071d2b451f4a9e3636f81 | 124 ++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 44/53f1f4a03d19a5450071d2b451f4a9e3636f81 diff --git a/44/53f1f4a03d19a5450071d2b451f4a9e3636f81 b/44/53f1f4a03d19a5450071d2b451f4a9e3636f81 new file mode 100644 index 000000000..617408402 --- /dev/null +++ b/44/53f1f4a03d19a5450071d2b451f4a9e3636f81 @@ -0,0 +1,124 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 7D2A3431FC0 + for ; Mon, 22 Sep 2014 08:34:12 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id LsAXFcImE5Cr for ; + Mon, 22 Sep 2014 08:34:06 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 5202D431FB6 + for ; Mon, 22 Sep 2014 08:34:06 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 3AD37100033; + Mon, 22 Sep 2014 18:33:52 +0300 (EEST) +From: Tomi Ollila +To: Gaute Hope , notmuch@notmuchmail.org +Subject: Re: [PATCH] Add configurable changed tag to messages that have + been changed on disk +In-Reply-To: <1411386960-astroid-2-k1e726ut3f-2518@strange> +References: <1396800683-9164-1-git-send-email-eg@gaute.vetsj.com> + <87fviiiuzn.fsf@maritornes.cs.unb.ca> + + <20140801185505.GS13893@mit.edu> + <1407313144-astroid-0-vyhth1tcrd-3835@strange> + <1411386960-astroid-2-k1e726ut3f-2518@strange> +User-Agent: Notmuch/0.18.1+97~g6c845ef (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Mon, 22 Sep 2014 15:34:12 -0000 + +On Mon, Sep 22 2014, Gaute Hope wrote: + +> Excerpts from Gaute Hope's message of August 6, 2014 10:29: +>> Austin Clements wrote on Fri, 01 Aug 2014 14:55:05 -0400: +>>> I have a prototype implementation of message modification times on my +>>> lastmod-v1 branch at +>>> +>>> https://github.com/aclements/notmuch/tree/lastmod-v1 +>>> +>>> It builds on my database features series that's currently awaiting +>>> review [1]. +>>> +>>> The series uses a monotonic revision number, rather than wall-clock +>>> time, for reasons related to Xapian's concurrent control and detailed +>>> in the main commit's commit message. The implementation isn't quite +>>> useful from the CLI yet because I haven't added any way to query the +>>> database's current revision number. (I'm still thinking about how I +>>> want to do this, since search/show don't have a good way to deliver +>>> "additional" information right now. I might just add the last +>>> modification for each individual message/max of all messages in a +>>> thread, similar to what Thomas Jost's patch did long ago.) +>>> +>>> [1] id:1406859003-11561-1-git-send-email-amdragon@mit.edu +> +>> this should allow me to do what I wish to accomplish. The message +>> deletion is still a problem though, I can see two options at the moment: +> +> Hi list, +> +> While exploring the possibility of syncing maildir/X-keywords with tags +> I had some thoughts about lastmod and message modification: +> +> As briefly discussed on #notmuch, I noticed that it seems that 'notmuch +> new' does not detect that a message source has been changed, unless the +> file is also re-named. +> +> This means that for instance if the X-Keywords fields have been updated +> in a message (from GMail with offlineimap, synclabels = yes) the lastmod +> field will remain unchanged, and a source modification will be +> undetectable to a client program using this value. +> +> Would it not make sense that if a message has a more recent mtime than +> at index time it is re-indexed? + +That would require notmuch to scan the contents of a directory for changed +mtimes of the files -- now notmuch skips looking for the files unless +directory mtime has changed. Directory mtime changes when files are +added/deleted/renamed (as that is what directory needs to know) -- file +mtime change are stored in file information and therefore change there does +not probagate to parent directory (and, if such happened, to it's parent +and so on...) + +That would mean the scanning would be slower than it is now. + +Tomi + +> +> Also, for the lastmod branch I would wish for a notmuch_message_touch() +> method where the lastmod time is updated to the last. As well as a +> notmuch_database_reindex_message () - possibly defined/documented +> behaviour for notmuch_database_add_message () when the filename is +> already added (in which case I would expect notmuch to re-index the +> message). +> +> Doing notmuch_database_remove_message followed by _add_message could +> risk deleting the entry if this file is the only on-disk-representation. +> +> Cheers, Gaute -- 2.26.2