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