unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Gaute Hope <eg@gaute.vetsj.com>
To: David Mazieres expires 2014-07-05 CEST
	<mazieres-2vu8n5xbqk4r8zkqh82n4qgci6@temporary-address.scs.stanford.edu>
Cc: notmuch <notmuch@notmuchmail.org>
Subject: Re: [PATCH] Add configurable changed tag to messages that have been changed on disk
Date: Thu, 10 Apr 2014 16:43:03 +0200	[thread overview]
Message-ID: <1397140962-sup-6514@qwerzila> (raw)
In-Reply-To: <87wqf2gqig.fsf@ta.scs.stanford.edu>

Excerpts from David Mazieres's message of 2014-04-06 22:19:19 +0200:
> Gaute Hope <eg@gaute.vetsj.com> writes:
>
> > When one of the source files for a message is changed on disk, renamed,
> > deleted or a new source file is added. A configurable changed tag is
> > is added. The tag can be configured under the option 'changed_tags' in
> > the [new] section, the default is none. Tests have been updated to
> > accept the new config option.
> >
> > notmuch-setup now asks for a changed tag after the new tags question.
> >
> > This could be useful for for example 'afew' to detect remote changes in
> > IMAP folders and update the FolderNameFilter to also add tags or remove
> > tags when a _existing_ message has been added to or removed from a
> > maildir.
>
> I think this is the wrong way to achieve such functionality, because
> then the change tag A) is expensive to remove, B) is easy to misuse
> (remember to call fsync everywhere before deleting the change tag), and
> C) can be used by only one application.
>
> A better approach would be to add a new "modtime" xapian value that is
> updated whenever the tags or any other terms (such as XFDIRENTRY) are
> added to or deleted from a docid.  If it's a Xapian value, rather than a
> term, then modtime will be queriable just like date, allowing multiple
> applications to query all docids modified since the last time they ran.
>
> [... snip]

This could also solve it, and probably have more uses. I don't quite see
how the opposite problem (for my use case) can be solved by this without
using a 'localchange' tag. This is to sync tag to maildir sync, when a
new tag has been added (by e.g. a user interaction in a client) it needs
to be copied to the maildir, if it is not done in the same go a
different application won't know whether the change was local or remote.
How did you solve this?

I would suggest using a Xapian- or Index-time which gets a tick
everytime a modification is made to the index. Atomic operations could
operate on the same time in case this distinction turns out to be
useful. Perhaps something like this already exists in Xapian? This way
clock skew, clock resolution (lots of operations happening in the same
second, msec or nanosec) problems won't be an issue. The crux will be to
make sure all write-operations trigger a tick on the indextime.

Regards, Gaute

  reply	other threads:[~2014-04-10 14:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 16:11 [PATCH] Add configurable changed tag to messages that have been changed on disk Gaute Hope
2014-04-06 20:19 ` David Mazieres
2014-04-10 14:43   ` Gaute Hope [this message]
2014-04-10 15:31     ` dm-list-email-notmuch
2014-04-10 21:10       ` Gaute Hope
2014-04-22 22:05         ` David Bremner
2014-04-23  7:24           ` Gaute Hope
2014-04-23  9:00             ` David Mazieres
2014-04-23 11:53               ` Gaute Hope
2014-04-23 20:59               ` Austin Clements
2014-04-23 22:31                 ` dm-list-email-notmuch
2014-04-11 11:08       ` David Bremner
2014-04-11 16:03         ` dm-list-email-notmuch
2014-04-12 15:58           ` David Bremner
2014-05-03 14:01             ` Jani Nikula
2014-04-23 21:28   ` Austin Clements
2014-04-23 22:40     ` David Mazieres expires 2014-07-22 PDT
2014-07-03 10:42 ` David Bremner
2014-07-28 14:37   ` Gaute Hope
2014-08-01 18:55     ` Austin Clements
2014-08-02  0:49       ` Austin Clements
2014-08-06  9:02       ` Gaute Hope
2014-08-06 17:06         ` Austin Clements
     [not found]       ` <1407313144-astroid-0-vyhth1tcrd-3835@strange>
2014-09-22 12:06         ` Gaute Hope
2014-09-22 15:33           ` Tomi Ollila
2014-09-22 15:40           ` Austin Clements
2014-09-23  6:57             ` Gaute Hope

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397140962-sup-6514@qwerzila \
    --to=eg@gaute.vetsj.com \
    --cc=mazieres-2vu8n5xbqk4r8zkqh82n4qgci6@temporary-address.scs.stanford.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).