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 055F0431FAF
\r
6 for <notmuch@notmuchmail.org>; Sun, 6 Jul 2014 13:41:15 -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 39ChE9zv4cvo for <notmuch@notmuchmail.org>;
\r
18 Sun, 6 Jul 2014 13:41:09 -0700 (PDT)
\r
19 Received: from qmta05.westchester.pa.mail.comcast.net
\r
20 (qmta05.westchester.pa.mail.comcast.net [76.96.62.48])
\r
21 by olra.theworths.org (Postfix) with ESMTP id 391EB431FBF
\r
22 for <notmuch@notmuchmail.org>; Sun, 6 Jul 2014 13:41:05 -0700 (PDT)
\r
23 Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71])
\r
24 by qmta05.westchester.pa.mail.comcast.net with comcast
\r
25 id P8DP1o0021YDfWL558h2NP; Sun, 06 Jul 2014 20:41:02 +0000
\r
26 Received: from odin.tremily.us ([24.18.63.50])
\r
27 by omta20.westchester.pa.mail.comcast.net with comcast
\r
28 id P8h11o00C152l3L3g8h1uR; 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 03D6D12700E9;
\r
31 Sun, 6 Jul 2014 13:41:01 -0700 (PDT)
\r
32 Received: (nullmailer pid 1919 invoked by uid 1000);
\r
33 Sun, 06 Jul 2014 20:40:28 -0000
\r
34 From: "W. Trevor King" <wking@tremily.us>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH 3/4] nmbug: Catch stderr in is_unmerged
\r
37 Date: Sun, 6 Jul 2014 13:40:21 -0700
\r
39 <d55cf02465c5f2d83f2dd0bc666831ee524b0fb7.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=lXcf0zWTcgH6bbxfJZoxTktKlJbNvM03i7CRd8nlNJE=;
\r
48 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
50 b=MVQVdq9Ip+WFirjgW/QRjiUmcP46ups4dcfp4Sta0pAMl9r5vE8Zd8q3qMl2dhlvl
\r
51 +2LaBRjILpDTvaxMYPOZYO81mxw0SzLpMnPdQoKgZ3i+yiKNtfJfrD1mz7lJz2glBE
\r
52 BwhcxmBoNyx0O3cnAs3o29D57cAr1JcL984Q0nDYvnyDmB6NnbgYz41xfdbLbJZOc8
\r
53 TDhaEqCWBtkSkqGr34aUNQE5tA1yzd7srKclLJnEwrNzfqTmJOrVdsj5OMKX0x9LpJ
\r
54 aIywRi9vePWJUzF0cRp8pe8En2DsRmRssZBAA1l3z8r3O7P+dEOTD6oiD4Vmuyxlfy
\r
56 Cc: 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:15 -0000
\r
71 Add a '-2|' dir for "execute the command and pipe both stdout and
\r
72 stderr to us". Use this to catch stderr from the rev-parse call in
\r
73 is_unmerged. We already check the status, so we don't want to confuse
\r
74 users with stuff like:
\r
76 error: No upstream configured for branch 'master'
\r
80 devel/nmbug/nmbug | 14 +++++++++++---
\r
81 1 file changed, 11 insertions(+), 3 deletions(-)
\r
83 diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
\r
84 index 998ee6b..c9ac046 100755
\r
85 --- a/devel/nmbug/nmbug
\r
86 +++ b/devel/nmbug/nmbug
\r
87 @@ -56,7 +56,7 @@ my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});
\r
89 my $envref = (ref $_[0] eq 'HASH') ? shift : {};
\r
90 my $ioref = (ref $_[0] eq 'ARRAY') ? shift : undef;
\r
91 - my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : undef;
\r
92 + my $dir = ($_[0] eq '-|' or $_[0] eq '-2|' or $_[0] eq '|-') ? shift : undef;
\r
95 $envref->{GIT_DIR} ||= $NMBGIT;
\r
96 @@ -83,10 +83,15 @@ sub git {
\r
98 my $envref = (ref $_[0] eq 'HASH') ? shift : {};
\r
99 my $ioref = (ref $_[0] eq 'ARRAY') ? shift : undef;
\r
100 - my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : '-|';
\r
101 + my $dir = ($_[0] eq '-|' or $_[0] eq '-2|' or $_[0] eq '|-') ? shift : '-|';
\r
102 + my $stderr_to_stdout = $dir eq '-2|';
\r
106 + if ($dir eq '-2|') {
\r
110 if (open my $child, $dir) {
\r
113 @@ -105,6 +110,9 @@ sub spawn {
\r
114 if ($dir ne '|-') {
\r
115 open STDIN, '<', '/dev/null' or die "reopening stdin: $!"
\r
117 + if ($stderr_to_stdout) {
\r
118 + open(STDERR, ">&STDOUT");
\r
123 @@ -430,7 +438,7 @@ sub do_status {
\r
125 my $commit = shift || '@{upstream}';
\r
127 - my ($fetch_head, $status) = git_with_status ('rev-parse', $commit);
\r
128 + my ($fetch_head, $status) = git_with_status ('-2|', 'rev-parse', $commit);
\r