All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: git@vger.kernel.org
Cc: Chris Packham <judge.packham@gmail.com>,
	Stephen Boyd <bebarino@gmail.com>
Subject: [RFC PATCHv2 2/2] am: avoid re-directing stdin twice
Date: Thu,  4 Sep 2014 10:21:58 +1200	[thread overview]
Message-ID: <1409782918-26133-3-git-send-email-judge.packham@gmail.com> (raw)
In-Reply-To: <1409782918-26133-1-git-send-email-judge.packham@gmail.com>

In check_patch_format we feed $1 to a block that attempts to determine
the patch format. Since we've already redirected $1 to stdin there is no
need to redirect it again when we invoke tr. This prevents the following
errors when invoking git am

  $ git am patch.patch
  tr: write error: Broken pipe
  tr: write error
  Patch format detection failed.

Cc: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
 git-am.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-am.sh b/git-am.sh
index f979925..5d69c89 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -253,7 +253,7 @@ check_patch_format () {
 			# discarding the indented remainder of folded lines,
 			# and see if it looks like that they all begin with the
 			# header field names...
-			tr -d '\015' <"$1" |
+			tr -d '\015' |
 			sed -n -e '/^$/q' -e '/^[ 	]/d' -e p |
 			sane_egrep -v '^[!-9;-~]+:' >/dev/null ||
 			patch_format=mbox
-- 
2.0.4.2.gadd452d

      parent reply	other threads:[~2014-09-03 22:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  9:35 [RFC PATCH 0/1] am: bug report and new patch format support Chris Packham
2014-09-03  9:35 ` [RFC PATCH 1/1] am: add gitk patch format Chris Packham
2014-09-03  9:59   ` Chris Packham
2014-09-03 10:18 ` [RFC PATCH 0/1] am: bug report and new patch format support Chris Packham
2014-09-03 22:21 ` [RFC PATCHv2 0/2] am: bug fix " Chris Packham
2014-09-03 22:21   ` [RFC PATCHv2 1/2] am: add gitk patch format Chris Packham
2014-09-03 23:19     ` Junio C Hamano
2014-09-04  0:46       ` Chris Packham
2014-09-04 17:21         ` Junio C Hamano
2014-09-04 22:47           ` Chris Packham
     [not found]             ` <CAPc5daWip1dQ5Or6hzmdjoBUStusvs-jK0ODNuzAotNfM5BLbQ@mail.gmail.com>
2014-09-05  1:23               ` Chris Packham
2014-09-05 18:29                 ` Junio C Hamano
2014-09-05 21:54                   ` Chris Packham
2014-09-03 22:21   ` Chris Packham [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409782918-26133-3-git-send-email-judge.packham@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.