Re: [PATCH v2 2/2] cli: add support for pre and post notmuch new hooks

Subject: Re: [PATCH v2 2/2] cli: add support for pre and post notmuch new hooks

Date: Sun, 04 Dec 2011 14:54:58 -0500

To: Jani Nikula, Austin Clements

Cc: notmuch@notmuchmail.org

From: Tom Prince


On Sun, 04 Dec 2011 21:36:21 +0200, Jani Nikula <jani@nikula.org> wrote:
> > > +    if (run_hooks && !ret && !interrupted)
> > > +	ret = notmuch_run_hook (db_path, "post-new");
> > 
> > Does it matter at this point if the hook fails?  I'm not sure.
> 
> I wasn't sure either, but I ended up thinking that the hooks become part
> of 'notmuch new' and claiming success when a hook fails is not quite
> right. This might have importance if scripting 'notmuch new'.

One can always add 'exit 0' (perhaps with appropriate traps) to the hook
script, if you don't want failure to propagate to 'notmuch new', but not
the reverse.

  Tom

Thread: