* lastmod based on date/time
@ 2022-08-01 9:52 Al Haji-Ali
2022-08-01 10:54 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Al Haji-Ali @ 2022-08-01 9:52 UTC (permalink / raw)
To: notmuch
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.
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.
If there's no way of doing this currently, is the time of modification saved in the database but is inaccessible through the current interface?
Best regards,
-- Al
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: lastmod based on date/time
2022-08-01 9:52 lastmod based on date/time Al Haji-Ali
@ 2022-08-01 10:54 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2022-08-01 10:54 UTC (permalink / raw)
To: Al Haji-Ali, notmuch
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-01 10:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 9:52 lastmod based on date/time Al Haji-Ali
2022-08-01 10:54 ` David Bremner
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).