Re: [PATCH v2 2/2] cli: add support for pre and post notmuch new hooks
authorTom Prince <tom.prince@ualberta.net>
Sun, 4 Dec 2011 19:54:58 +0000 (14:54 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:34 +0000 (09:40 -0800)
1f/bf9db192a8ed0d49106cfb94a55e5e32d820d3 [new file with mode: 0644]

diff --git a/1f/bf9db192a8ed0d49106cfb94a55e5e32d820d3 b/1f/bf9db192a8ed0d49106cfb94a55e5e32d820d3
new file mode 100644 (file)
index 0000000..dbf3789
--- /dev/null
@@ -0,0 +1,69 @@
+Return-Path: <tom.prince@ualberta.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1575D429E25\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 11:55:03 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 2q2bnuYvZafc for <notmuch@notmuchmail.org>;\r
+       Sun,  4 Dec 2011 11:55:02 -0800 (PST)\r
+Received: from socrates.hocat.ca (socrates.hocat.ca [76.10.188.53])\r
+       by olra.theworths.org (Postfix) with ESMTP id 71F7A429E21\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 11:55:02 -0800 (PST)\r
+Received: from hermes.hocat.ca (hermes.hocat.ca [69.165.170.253])\r
+       by socrates.hocat.ca (Postfix) with SMTP id 454AB14E6;\r
+       Sun,  4 Dec 2011 12:55:00 -0700 (MST)\r
+Received: (nullmailer pid 20598 invoked by uid 1000);\r
+       Sun, 04 Dec 2011 19:54:58 -0000\r
+From: Tom Prince <tom.prince@ualberta.net>\r
+To: Jani Nikula <jani@nikula.org>, Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH v2 2/2] cli: add support for pre and post notmuch new\r
+ hooks\r
+In-Reply-To: <87pqg4ku2y.fsf@nikula.org>\r
+References:\r
+ <6688b09fffa2a66b496af78008102f88ab4e9450.1322953841.git.jani@nikula.org>\r
+       <6ccaa31da55b0dfc9e339780e43e24e1489235e8.1322953841.git.jani@nikula.org>\r
+       <20111204040047.GB16405@mit.edu> <87pqg4ku2y.fsf@nikula.org>\r
+User-Agent: Notmuch/0.10.1 (http://notmuchmail.org) Emacs/23.3.3\r
+       (x86_64-pc-linux-gnu)\r
+Date: Sun, 04 Dec 2011 14:54:58 -0500\r
+Message-ID: <871uskglil.fsf@hermes.hocat.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 04 Dec 2011 19:55:03 -0000\r
+\r
+On Sun, 04 Dec 2011 21:36:21 +0200, Jani Nikula <jani@nikula.org> wrote:\r
+> > > +    if (run_hooks && !ret && !interrupted)\r
+> > > +        ret = notmuch_run_hook (db_path, "post-new");\r
+> > \r
+> > Does it matter at this point if the hook fails?  I'm not sure.\r
+> \r
+> I wasn't sure either, but I ended up thinking that the hooks become part\r
+> of 'notmuch new' and claiming success when a hook fails is not quite\r
+> right. This might have importance if scripting 'notmuch new'.\r
+\r
+One can always add 'exit 0' (perhaps with appropriate traps) to the hook\r
+script, if you don't want failure to propagate to 'notmuch new', but not\r
+the reverse.\r
+\r
+  Tom\r