Re: WIP: git-remote-notmuch

2024-08-28 Thread David Bremner
David Bremner writes: > 3) The original script took a path to mail_root, but this doesn't > really cover the possible split configurations; in particular it > doesn't handle my (XDG) layout. The current code just looks for the > "default" notmuch setup, and ignores the URL. I am open to ideas fo

[PATCH 5/5] cli/git-remote: add time performance test

2024-08-28 Thread David Bremner
Memory tests already existed (for correctness) but this helps sanity check the performance to make sure we are in the same range as the existing notmuch-git script. --- performance-test/T08-git-remote.sh | 23 +++ 1 file changed, 23 insertions(+) create mode 100755 performance

[PATCH 1/5] util: refactor sync_dir and mkdir_recursive

2024-08-28 Thread David Bremner
Moving these functions to libnotmuch_util will allow re-user from either multiple CLI compilation units or from the library. To avoid future surprises, replace printing to stderr with the usual status string mechanism. --- notmuch-insert.c | 84 + util/path-

[PATCH 4/5] cli/git-remote: add export command

2024-08-28 Thread David Bremner
This enables the push command, and the helper is now feature complete. --- git-remote-notmuch.c| 157 test/T860-git-remote.sh | 69 ++ test/make-export.py | 44 +++ 3 files changed, 270 insertions(+) create mode 100644 tes

[PATCH 2/5] cli: start remote helper for git.

2024-08-28 Thread David Bremner
This is closely based on git-remote-nm (in ruby) by Felipe Contreras. Initially just implement the commands 'capabilites' and 'list'. This isn't enough to do anything useful so start some unit tests. --- Makefile.local | 7 +- git-remote-notmuch.c| 181 +

[PATCH 3/5] cli/git-remote: add support for import command

2024-08-28 Thread David Bremner
The output in default.import is based on a modified version of Felipe's git-remote-nm with Blake2 hashing replaced by SHA1 (for portability). This enable git-pull, so test that as well. --- git-remote-notmuch.c| 129 test/T860-git-remote.sh | 38 ++

WIP: git-remote-notmuch

2024-08-28 Thread David Bremner
I wanted to try out Felipe's idea of using a remote helper to replace / augment the existing notmuch-git script, but I didn't want to require language bindings. Porting Felipe's ruby script to C led to a predictable amount of increase in the number of lines of code, but it seems to work. There are