Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1575D429E25 for ; Sun, 4 Dec 2011 11:55:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2q2bnuYvZafc for ; Sun, 4 Dec 2011 11:55:02 -0800 (PST) Received: from socrates.hocat.ca (socrates.hocat.ca [76.10.188.53]) by olra.theworths.org (Postfix) with ESMTP id 71F7A429E21 for ; Sun, 4 Dec 2011 11:55:02 -0800 (PST) Received: from hermes.hocat.ca (hermes.hocat.ca [69.165.170.253]) by socrates.hocat.ca (Postfix) with SMTP id 454AB14E6; Sun, 4 Dec 2011 12:55:00 -0700 (MST) Received: (nullmailer pid 20598 invoked by uid 1000); Sun, 04 Dec 2011 19:54:58 -0000 From: Tom Prince To: Jani Nikula , Austin Clements Subject: Re: [PATCH v2 2/2] cli: add support for pre and post notmuch new hooks In-Reply-To: <87pqg4ku2y.fsf@nikula.org> References: <6688b09fffa2a66b496af78008102f88ab4e9450.1322953841.git.jani@nikula.org> <6ccaa31da55b0dfc9e339780e43e24e1489235e8.1322953841.git.jani@nikula.org> <20111204040047.GB16405@mit.edu> <87pqg4ku2y.fsf@nikula.org> User-Agent: Notmuch/0.10.1 (http://notmuchmail.org) Emacs/23.3.3 (x86_64-pc-linux-gnu) Date: Sun, 04 Dec 2011 14:54:58 -0500 Message-ID: <871uskglil.fsf@hermes.hocat.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 19:55:03 -0000 On Sun, 04 Dec 2011 21:36:21 +0200, Jani Nikula 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