post-tag hook?

2015-06-11 Thread Daniel Schoepe
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



Re: post-tag hook?

2015-06-10 Thread Daniel Schoepe
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

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


post-tag hook?

2015-02-25 Thread Christophe-Marie Duquesne
Ah! Clever, I like the idea of using mtime.
-- next part --
An HTML attachment was scrubbed...
URL: 



post-tag hook?

2015-02-25 Thread David Bremner
Christophe-Marie Duquesne  writes:

>
> I would like to keep in sync tags and folder names. The problem is that it
> requires a full scan of the notmuch db, which is slow. If I was running
> this script only on messages that got retagged since like run of my script
> it would be much faster. Unfortunately I don't find a way to mark/save
> these messages in a notmuch hook.
>
> I found an old thread from 2012, where somebody mentionned they implemented
> a post-tag hook. Was this ever integrated?
>

I think the concensus was that we would rather go for tag "mtimes"
as started with the series

   id:1413181203-1676-1-git-send-email-aclements at csail.mit.edu

Unfortunately nobody yet found time to finish that series.

d


post-tag hook?

2015-02-25 Thread Christophe-Marie Duquesne
Hi,

Is there a way to run a command every time a message gets tagged?

I would like to keep in sync tags and folder names. The problem is that it
requires a full scan of the notmuch db, which is slow. If I was running
this script only on messages that got retagged since like run of my script
it would be much faster. Unfortunately I don't find a way to mark/save
these messages in a notmuch hook.

I found an old thread from 2012, where somebody mentionned they implemented
a post-tag hook. Was this ever integrated?

Cheers,
Christophe-Marie
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20150225/4d4d80ca/attachment.html>


Re: post-tag hook?

2015-02-25 Thread Christophe-Marie Duquesne
Ah! Clever, I like the idea of using mtime.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: post-tag hook?

2015-02-24 Thread David Bremner
Christophe-Marie Duquesne  writes:

>
> I would like to keep in sync tags and folder names. The problem is that it
> requires a full scan of the notmuch db, which is slow. If I was running
> this script only on messages that got retagged since like run of my script
> it would be much faster. Unfortunately I don't find a way to mark/save
> these messages in a notmuch hook.
>
> I found an old thread from 2012, where somebody mentionned they implemented
> a post-tag hook. Was this ever integrated?
>

I think the concensus was that we would rather go for tag "mtimes"
as started with the series

   id:1413181203-1676-1-git-send-email-acleme...@csail.mit.edu

Unfortunately nobody yet found time to finish that series.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


post-tag hook?

2015-02-24 Thread Christophe-Marie Duquesne
Hi,

Is there a way to run a command every time a message gets tagged?

I would like to keep in sync tags and folder names. The problem is that it
requires a full scan of the notmuch db, which is slow. If I was running
this script only on messages that got retagged since like run of my script
it would be much faster. Unfortunately I don't find a way to mark/save
these messages in a notmuch hook.

I found an old thread from 2012, where somebody mentionned they implemented
a post-tag hook. Was this ever integrated?

Cheers,
Christophe-Marie
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch