post-tag hook?

Daniel Schoepe daniel at schoepe.org
Wed Jun 10 15:42:36 PDT 2015


Hi,

for what it's worth, you can simulate a post-tag hook in a somewhat ugly
way by putting a script called "notmuch" in front of the notmuch binary
in your PATH. The script can then call the original notmuch binary as
usual, inspect the first argument, and, if it's "tag", invoke your
script afterwards. I.e. something like this:

-------------------------------------
#!/bin/sh

/usr/bin/notmuch $@
retval=$?
if [[ "$1" == "tag" ]]; then
   shift 1
   your-script $@
fi
exit $retval
-------------------------------------

On a more general note, I'm experimenting with a way to synchronize tags
by logging and replaying tag commands performed on other machines and
for such an approach a post-tag hook would help. It seems to me that not
all use cases for a post-tag hook can be handled as nicely with mtimes.

Best regards,
Daniel



More information about the notmuch mailing list