git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Mery <amery@geeks.cl>
To: git@vger.kernel.org
Subject: [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems
Date: Tue, 17 Jun 2008 13:43:57 +0200	[thread overview]
Message-ID: <4857A37D.8040004@geeks.cl> (raw)

head -<n> was deprecated by POSIX, and as modern versions of coreutils
package don't support it at least one exports _POSIX2_VERSION=199209
it's fails on some systems.

head -n<n> is portable, but sed <n>q is even more.

Signed-off-by: Alejandro Mery <amery@geeks.cl>
---
 git-am.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index b48096e..2c517ed 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -421,7 +421,7 @@ do
 	else
 	    action=yes
 	fi
-	FIRSTLINE=$(head -1 "$dotest/final-commit")
+	FIRSTLINE=$(sed 1q "$dotest/final-commit")
 
 	if test $action = skip
 	then
--
1.5.4.3 

             reply	other threads:[~2008-06-17 11:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-17 11:43 Alejandro Mery [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-16 20:02 (unknown) amery
2008-06-16 20:26 ` [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems Jakub Narebski
2008-06-16 20:43   ` Alejandro Mery

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=4857A37D.8040004@geeks.cl \
    --to=amery@geeks.cl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).