Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / ba / 3820c6ba3f20793983800e4269cb82424c4042
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
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \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
14         autolearn=disabled\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
38 Message-Id:\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
49         Message-Id;\r
50         b=MVQVdq9Ip+WFirjgW/QRjiUmcP46ups4dcfp4Sta0pAMl9r5vE8Zd8q3qMl2dhlvl\r
51         +2LaBRjILpDTvaxMYPOZYO81mxw0SzLpMnPdQoKgZ3i+yiKNtfJfrD1mz7lJz2glBE\r
52         BwhcxmBoNyx0O3cnAs3o29D57cAr1JcL984Q0nDYvnyDmB6NnbgYz41xfdbLbJZOc8\r
53         TDhaEqCWBtkSkqGr34aUNQE5tA1yzd7srKclLJnEwrNzfqTmJOrVdsj5OMKX0x9LpJ\r
54         aIywRi9vePWJUzF0cRp8pe8En2DsRmRssZBAA1l3z8r3O7P+dEOTD6oiD4Vmuyxlfy\r
55         qNH/qbp8xikzA==\r
56 Cc: David Bremner <bremner@debian.org>\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\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
70 \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
75 \r
76   error: No upstream configured for branch 'master'\r
77 \r
78 on nmbug's stderr.\r
79 ---\r
80  devel/nmbug/nmbug | 14 +++++++++++---\r
81  1 file changed, 11 insertions(+), 3 deletions(-)\r
82 \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
88  sub git_pipe {\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
93  \r
94    unshift @_, 'git';\r
95    $envref->{GIT_DIR} ||= $NMBGIT;\r
96 @@ -83,10 +83,15 @@ sub git {\r
97  sub spawn {\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
103  \r
104    die unless @_;\r
105  \r
106 +  if ($dir eq '-2|') {\r
107 +    $dir = '-|';\r
108 +  }\r
109 +\r
110    if (open my $child, $dir) {\r
111      return $child;\r
112    }\r
113 @@ -105,6 +110,9 @@ sub spawn {\r
114        if ($dir ne '|-') {\r
115         open STDIN, '<', '/dev/null' or die "reopening stdin: $!"\r
116        }\r
117 +      if ($stderr_to_stdout) {\r
118 +       open(STDERR, ">&STDOUT");\r
119 +      }\r
120        exec @_;\r
121        die "exec @_: $!";\r
122      }\r
123 @@ -430,7 +438,7 @@ sub do_status {\r
124  sub is_unmerged {\r
125    my $commit = shift || '@{upstream}';\r
126  \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
129    if ($status) {\r
130      return 0;\r
131    }\r
132 -- \r
133 1.9.1.353.gc66d89d\r
134 \r