git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (unknown)
@ 2008-06-16 20:02 amery
  2008-06-16 20:26 ` [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: amery @ 2008-06-16 20:02 UTC (permalink / raw)


>From 25cb047690dd6101527cdfa6198dd6a6f93bf095 Mon Sep 17 00:00:00 2001
From: Alejandro Mery <amery@geeks.cl>
Date: Mon, 16 Jun 2008 20:27:14 +0200
Subject: [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems

http://www.opengroup.org/onlinepubs/009695399/utilities/head.html
---
 git-am.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index b48096e..797988f 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=$(head -n1 "$dotest/final-commit")
 
 	if test $action = skip
 	then
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems
@ 2008-06-17 11:43 Alejandro Mery
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Mery @ 2008-06-17 11:43 UTC (permalink / raw)
  To: git

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 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-17 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2008-06-17 11:43 Alejandro Mery

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).