WIP: promote nmbug to user sync tool

Subject: WIP: promote nmbug to user sync tool

Date: Sat, 23 Apr 2022 10:38:32 -0300

To: notmuch@notmuchmail.org


From: David Bremner

One of the things that new (and old) users of notmuch often miss is a
way to sync tags between hosts. muchsync exists, but it's a third
party tool, and (if I understand correctly) it directly modifies the
notmuch database. Meanwhile we ship a moderately complex python script
called 'nmbug' which can be used to sync arbitrary tags between hosts.
This series is my (first pass at an) attempt to promote nmbug to a
notmuch subcommand "notmuch git". My plan is to replace my own
homebrew "commit notmuch dump output to git" script with this new
command; I think it may appeal to other users as well. As a bonus, it
provides a simple (for the user) way to do incremental backups of the
notmuch database.

I had to add a couple of caching tricks to make the script usable for
my database, but it is now reasonably fast (say 20s) to commit a days
worth of changes on my machine.

There are still some rough edges, mainly due to the heritage of the
script. Some I am aware of include:

- the (new) man page is inadequate
- notmuch git doesn't understand the common arguments to notmuch (--config and friends)
- the defaults for prefix and git repo are wrong for most users. I was thinking about either a
  --nmbug argument to set the old defaults, or having the script recognize if it is invoked as nmbug.
- There are a few too many global variables
- I just remembered, MAX_LASTMOD is unused, leftover from a previous design for querying tags.

One thing that not everyone will like is that this requires sexp
queries in your version of notmuch. It's exactly the kind of
application I had in mind when I built the sexp query parser (script
generated queries), and the sexp queries actually allow fixing an
escaping bug in the current nmbug

notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org