Re: [PATCH v2 3/8] show: Allow formatters to return errors
authorAustin Clements <amdragon@MIT.EDU>
Sun, 11 Mar 2012 23:34:08 +0000 (19:34 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:24 +0000 (09:45 -0800)
f3/6166f4a772a08058f82bdf7ee319991e11ac17 [new file with mode: 0644]

diff --git a/f3/6166f4a772a08058f82bdf7ee319991e11ac17 b/f3/6166f4a772a08058f82bdf7ee319991e11ac17
new file mode 100644 (file)
index 0000000..2af6b29
--- /dev/null
@@ -0,0 +1,111 @@
+Return-Path: <amdragon@mit.edu>\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 6BC45431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 11 Mar 2012 16:34:14 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 PWvpXduA722L for <notmuch@notmuchmail.org>;\r
+       Sun, 11 Mar 2012 16:34:13 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
+       [18.7.68.37])\r
+       by olra.theworths.org (Postfix) with ESMTP id B9731431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 11 Mar 2012 16:34:13 -0700 (PDT)\r
+X-AuditID: 12074425-b7f4a6d0000008e0-ea-4f5d36722f27\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 20.E7.02272.2763D5F4; Sun, 11 Mar 2012 19:34:10 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q2BNYAQH008747; \r
+       Sun, 11 Mar 2012 19:34:10 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2BNY8iB029746\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 11 Mar 2012 19:34:09 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1S6sHA-0002aS-6U; Sun, 11 Mar 2012 19:34:08 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 3/8] show: Allow formatters to return errors\r
+In-Reply-To: <87ipihbf0w.fsf@qmul.ac.uk>\r
+References: <1330752025-2542-1-git-send-email-amdragon@mit.edu>\r
+       <1331059724-14653-1-git-send-email-amdragon@mit.edu>\r
+       <1331059724-14653-4-git-send-email-amdragon@mit.edu>\r
+       <87ipihbf0w.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.11.1+252~gdf1a6d5 (http://notmuchmail.org) Emacs/23.3.1\r
+       (i486-pc-linux-gnu)\r
+Date: Sun, 11 Mar 2012 19:34:08 -0400\r
+Message-ID: <87wr6qsoen.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsUixCmqrVtkFutvsOiPscXquTwW12/OZHZg\r
+       8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4MjburymYwF2x7eMt1gbGDxxdjJwcEgImEsuW\r
+       XGWDsMUkLtxbD2RzcQgJ7GOU2PvxPguEs4FR4u2hV8wQzkkmibWPlkE5Sxgl5v39A9bPJqAh\r
+       sW3/ckYQW0TAVeLpt8/MILawgLPEykl3WUFsTqCatSffsUI0H2WUeLz3FgtIQlQgUWJ9530m\r
+       EJtFQFViz4rPYA28QAf2PpwCZQtKnJz5BKyeWUBL4sa/l0wTGAVmIUnNQpJawMi0ilE2JbdK\r
+       NzcxM6c4NVm3ODkxLy+1SNdCLzezRC81pXQTIygk2V1UdzBOOKR0iFGAg1GJh5fLIMpfiDWx\r
+       rLgy9xCjJAeTkihvhkmsvxBfUn5KZUZicUZ8UWlOavEhRgkOZiUR3oeGQDnelMTKqtSifJiU\r
+       NAeLkjivptY7PyGB9MSS1OzU1ILUIpisDAeHkgRvtClQo2BRanpqRVpmTglCmomDE2Q4D9Dw\r
+       bpAa3uKCxNzizHSI/ClGRSlx3hKQhABIIqM0D64XljJeMYoDvSLMWw9SxQNMN3Ddr4AGMwEN\r
+       /swVDTK4JBEhJdXAaO5VnMU74Ud1pp/1nRK7z2YpzTv9NT50f/a2Oqlqc1NVNKNnW4HgwlTO\r
+       1zpTNnr3bH45ue7u8ijloB9n1zFc9o5J9G1LjJldfePBxAnHr7Qu9QjJyhRy8f63fFVK5amJ\r
+       BnFfApftl1Fbpjp9i9Oi5VYBszfecV+hdzZZ8dCSaZHhsi1KReWMSizFGYmGWsxFxYkAOQZx\r
+       9PQCAAA=\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, 11 Mar 2012 23:34:14 -0000\r
+\r
+On Tue, 06 Mar 2012 21:22:55 +0000, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> On Tue,  6 Mar 2012 18:48:39 +0000, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > Formatter errors are propagated to the exit status of notmuch show.\r
+> > \r
+> > This isn't used by the JSON or text formatters, but it will be useful\r
+> > for the raw format, which is pickier.\r
+> \r
+> I am not very familiar with this part of the code but the whole series\r
+> looks fine to me.\r
+> \r
+> My only minor comment is that I like Tom's suggestion (in\r
+> id:"m2399qrtat.fsf@guru.guru-group.fi") of having NOTMUCH_STATUS_FAILURE\r
+> (= 1) to make the error handling look cleaner. Alternatively (or\r
+\r
+We could introduce a generic failure, though it couldn't be equal to 1\r
+without breaking binary compatibility.  I'm not sure a generic failure\r
+would make things much better, though; as far as I can tell, error\r
+handling in C is doomed to ugliness.\r
+\r
+> possibly as well) the functions do_show and do_show_messages could pass\r
+> the actual error back up to notmuch_show_command and then that function\r
+> could convert return 0/1 as appropriate.\r
+\r
+I would be happy to be convinced either way.  It's the way it is because\r
+I didn't bother changing it and because I think it's reasonable to think\r
+of do_show and do_show_messages as extensions of notmuch_show_command.\r
+\r
+> As usual I am quite happy to be overruled!\r
+> \r
+> Best wishes\r
+> \r
+> Mark\r
+> \r