unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Al Haji-Ali <abdo.haji.ali@gmail.com>, notmuch@notmuchmail.org
Subject: Re: lastmod based on date/time
Date: Mon, 01 Aug 2022 07:54:09 -0300	[thread overview]
Message-ID: <87edy0p73i.fsf@tethera.net> (raw)
In-Reply-To: <x1oilnce1dy.fsf@gmail.com>

Al Haji-Ali <abdo.haji.ali@gmail.com> writes:

> Would it be possible to search for lastmod messages based on time
> rather than revision ID?  Using revision ID is convenient for
> tools/scripts, but not for actual everyday use.
>

The modification time is not saved in the database.

> I sometimes find myself needing to find a message that I accidentally
> archived/moved and it would be convenient if I can list all the
> messages that I modified (tag or otherwise) in the past day for
> example. I currently use the current value of revision ID minus a few
> hundreds as a proxy for time.

A workaround could be to run a cron job or equivalent that logs
(lastmod,timestamp) pairs to a file. Of course that would make using the
information a bit inconvenient without further tooling.

Because of concerns about performance, we have so far resisted having a
"tagging hook".  'lastmod:' was added at some point because it addressed
some of the usecases for a tagging hook.

At the time (2014) we chose the counter approach over timestamps because
of the difficulty of synchronizing clocks between machines and the
possibility of clock changes on a given machine [1]. In principle
modification timestamps could be added as additional data for each
message. I'm not sure about the cost/benefit here (either for
implementation or performance) but if someone wants to investigate
further I can point them in the right direction (mostly, copy the
lastmod stuff).

[1]: I think most of the discussion is in the thread 
https://nmbug.notmuchmail.org/nmweb/show/1396800683-9164-1-git-send-email-eg%40gaute.vetsj.com

      reply	other threads:[~2022-08-01 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01  9:52 lastmod based on date/time Al Haji-Ali
2022-08-01 10:54 ` David Bremner [this message]

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=87edy0p73i.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=abdo.haji.ali@gmail.com \
    --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).