1 Return-Path: <wking@tremily.us>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 0D981431FD5
\r
6 for <notmuch@notmuchmail.org>; Sun, 6 Jul 2014 13:41:09 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
13 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id xCaDQjXAm5Uj for <notmuch@notmuchmail.org>;
\r
18 Sun, 6 Jul 2014 13:41:03 -0700 (PDT)
\r
19 Received: from qmta02.westchester.pa.mail.comcast.net
\r
20 (qmta02.westchester.pa.mail.comcast.net [76.96.62.24])
\r
21 by olra.theworths.org (Postfix) with ESMTP id 68AA3431FAF
\r
22 for <notmuch@notmuchmail.org>; Sun, 6 Jul 2014 13:41:03 -0700 (PDT)
\r
23 Received: from omta11.westchester.pa.mail.comcast.net ([76.96.62.36])
\r
24 by qmta02.westchester.pa.mail.comcast.net with comcast
\r
25 id P8Wk1o0020mv7h0518h2fB; Sun, 06 Jul 2014 20:41:02 +0000
\r
26 Received: from odin.tremily.us ([24.18.63.50])
\r
27 by omta11.westchester.pa.mail.comcast.net with comcast
\r
28 id P8h01o00Y152l3L3X8h1kw; Sun, 06 Jul 2014 20:41:02 +0000
\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])
\r
30 by odin.tremily.us (Postfix) with ESMTPS id DBDB212700E5;
\r
31 Sun, 6 Jul 2014 13:40:59 -0700 (PDT)
\r
32 Received: (nullmailer pid 1903 invoked by uid 1000);
\r
33 Sun, 06 Jul 2014 20:40:27 -0000
\r
34 From: "W. Trevor King" <wking@tremily.us>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH 1/4] nmbug: Add a git_with_status helper function
\r
37 Date: Sun, 6 Jul 2014 13:40:19 -0700
\r
39 <6ed6edd459cd50402d7e4abc50a6967709e08f16.1404678709.git.wking@tremily.us>
\r
40 X-Mailer: git-send-email 1.9.1.353.gc66d89d
\r
41 In-Reply-To: <cover.1404678709.git.wking@tremily.us>
\r
42 References: <cover.1404678709.git.wking@tremily.us>
\r
43 In-Reply-To: <cover.1404678709.git.wking@tremily.us>
\r
44 References: <cover.1404678709.git.wking@tremily.us>
\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
46 s=q20140121; t=1404679262;
\r
47 bh=F8943E/wKjGwJI6o5yUo8yKieldJZmtDMJYcSp0mvB0=;
\r
48 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
50 b=ffL4y7Es10phNqbHXfZElBlRZpYeNx3stg7ER4TEko5NMVR20W8i/Z/R6T1sj63gS
\r
51 EI3RU5/RksOZxtBZktUmoEZ9W0lS02nj/0z1C0bMT2xdCeJMl/E/ntvCpT1beDg21u
\r
52 3a3y0F7CBFsO1AblQ8LNUpVj8kA2/DqUzOkQv1reDzLNtE9tVgxNufUhc5GrS+ecKb
\r
53 SHlBrlkUcIcoJ4VSCx+f9G7Ueq/6aOoP+ZXklYOzLi0BzJmyhK1fzha2kIBf2OXOX6
\r
54 pca5EC9vxi8N2v17WWUqgTs/JDLbpHxW02LXSkIYcN/8j3lWrkrc3R8vxRGMR/Rxb3
\r
56 Cc: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <bremner@debian.org>
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Sun, 06 Jul 2014 20:41:09 -0000
\r
71 Sometimes we want to catch Git errors and handle them, instead of
\r
72 dying with an error message. This lower-level version of git() allows
\r
73 us to get the error status when we want it.
\r
75 devel/nmbug/nmbug | 13 ++++++++++---
\r
76 1 file changed, 10 insertions(+), 3 deletions(-)
\r
78 diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
\r
79 index b18ded7..4a79722 100755
\r
80 --- a/devel/nmbug/nmbug
\r
81 +++ b/devel/nmbug/nmbug
\r
82 @@ -63,13 +63,20 @@ sub git_pipe {
\r
83 spawn ($envref, defined $ioref ? $ioref : (), defined $dir ? $dir : (), @_);
\r
87 +sub git_with_status {
\r
88 my $fh = git_pipe (@_);
\r
89 my $str = join ('', <$fh>);
\r
90 - unless (close $fh) {
\r
94 + return ($str, $status);
\r
98 + my ($str, $status) = git_with_status (@_);
\r
100 die "'git @_' exited with nonzero value\n";
\r