* [PATCH] tail -n not supported in all OSs
@ 2007-10-16 16:57 Jari Aalto
2007-10-16 16:57 ` [PATCH] git-am.sh: Remove option -n from tail Jari Aalto
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Jari Aalto @ 2007-10-16 16:57 UTC (permalink / raw)
To: git
SunOS/Solaris tail(1) does not support option '-n'. The
following patches change occurrances of:
tail -n <N>
to
tail <N>
---------------------------------------------------------------------
REFERENCES:
User Commands TAIL(1)
NAME
tail - output the last part of files
SYNOPSIS
tail [OPTION]... [FILE]...
- - -
$ uname -a
SunOS host 5.9 Generic_118558-35 sun4u sparc SUNW,Serverblade1
$ echo | tail -n 1
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] git-am.sh: Remove option -n from tail
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
@ 2007-10-16 16:57 ` Jari Aalto
2007-10-16 16:57 ` [PATCH] git-commit.sh: " Jari Aalto
2007-10-16 17:12 ` [PATCH] tail -n not supported in all OSs David Brown
` (4 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Jari Aalto @ 2007-10-16 16:57 UTC (permalink / raw)
To: git; +Cc: Jari Aalto
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
git-am.sh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index b02ae6a..09a991c 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -2,6 +2,8 @@
#
# Copyright (c) 2005, 2006 Junio C Hamano
+TAIL="tail"
+
USAGE='[--signoff] [--dotest=<dir>] [--keep] [--utf8 | --no-utf8]
[--3way] [--interactive] [--binary]
[--whitespace=<option>] [-C<n>] [-p<n>]
@@ -321,7 +323,7 @@ do
LAST_SIGNED_OFF_BY=`
sed -ne '/^Signed-off-by: /p' \
"$dotest/msg-clean" |
- tail -n 1
+ $TAIL 1
`
ADD_SIGNOFF=`
test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
--
1.5.3.2.81.g17ed
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] git-commit.sh: Remove option -n from tail
2007-10-16 16:57 ` [PATCH] git-am.sh: Remove option -n from tail Jari Aalto
@ 2007-10-16 16:57 ` Jari Aalto
2007-10-16 16:57 ` [PATCH] git-rebase--interactive.sh: " Jari Aalto
2007-10-16 17:18 ` [PATCH] git-commit.sh: " Johannes Schindelin
0 siblings, 2 replies; 10+ messages in thread
From: Jari Aalto @ 2007-10-16 16:57 UTC (permalink / raw)
To: git; +Cc: Jari Aalto
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
git-commit.sh | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/git-commit.sh b/git-commit.sh
index fcb8443..637cf48 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -3,6 +3,8 @@
# Copyright (c) 2005 Linus Torvalds
# Copyright (c) 2006 Junio C Hamano
+TAIL="tail"
+
USAGE='[-a | --interactive] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [--template <file>] [[-i | -o] <path>...]'
SUBDIRECTORY_OK=Yes
. git-sh-setup
@@ -442,10 +444,10 @@ t)
s/^/Signed-off-by: /
')
blank_before_signoff=
- tail -n 1 "$GIT_DIR"/COMMIT_EDITMSG |
+ $TAIL 1 "$GIT_DIR"/COMMIT_EDITMSG |
grep 'Signed-off-by:' >/dev/null || blank_before_signoff='
'
- tail -n 1 "$GIT_DIR"/COMMIT_EDITMSG |
+ $TAIL 1 "$GIT_DIR"/COMMIT_EDITMSG |
grep "$sign"$ >/dev/null ||
printf '%s%s\n' "$blank_before_signoff" "$sign" \
>>"$GIT_DIR"/COMMIT_EDITMSG
--
1.5.3.2.81.g17ed
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] git-rebase--interactive.sh: Remove option -n from tail
2007-10-16 16:57 ` [PATCH] git-commit.sh: " Jari Aalto
@ 2007-10-16 16:57 ` Jari Aalto
2007-10-16 17:18 ` [PATCH] git-commit.sh: " Johannes Schindelin
1 sibling, 0 replies; 10+ messages in thread
From: Jari Aalto @ 2007-10-16 16:57 UTC (permalink / raw)
To: git; +Cc: Jari Aalto
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
git-rebase--interactive.sh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 050140d..58e164c 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -10,6 +10,8 @@
# The original idea comes from Eric W. Biederman, in
# http://article.gmane.org/gmane.comp.version-control.git/22407
+TAIL="tail"
+
USAGE='(--continue | --abort | --skip | [--preserve-merges] [--verbose]
[--onto <branch>] <upstream> [<branch>])'
@@ -204,7 +206,7 @@ nth_string () {
make_squash_message () {
if test -f "$SQUASH_MSG"; then
COUNT=$(($(sed -n "s/^# This is [^0-9]*\([1-9][0-9]*\).*/\1/p" \
- < "$SQUASH_MSG" | tail -n 1)+1))
+ < "$SQUASH_MSG" | $TAIL 1)+1))
echo "# This is a combination of $COUNT commits."
sed -n "2,\$p" < "$SQUASH_MSG"
else
--
1.5.3.2.81.g17ed
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] tail -n not supported in all OSs
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
2007-10-16 16:57 ` [PATCH] git-am.sh: Remove option -n from tail Jari Aalto
@ 2007-10-16 17:12 ` David Brown
2007-10-16 17:16 ` YOSHIFUJI Hideaki / 吉藤英明
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: David Brown @ 2007-10-16 17:12 UTC (permalink / raw)
To: Jari Aalto; +Cc: git
On Tue, Oct 16, 2007 at 07:57:14PM +0300, Jari Aalto wrote:
>
>SunOS/Solaris tail(1) does not support option '-n'. The
>following patches change occurrances of:
>
> tail -n <N>
>
>to
>
> tail <N>
On Linux, I get
tail: cannot open `1' for reading: No such file or directory
Did you want
tail -<N>
David
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tail -n not supported in all OSs
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
2007-10-16 16:57 ` [PATCH] git-am.sh: Remove option -n from tail Jari Aalto
2007-10-16 17:12 ` [PATCH] tail -n not supported in all OSs David Brown
@ 2007-10-16 17:16 ` YOSHIFUJI Hideaki / 吉藤英明
2007-10-16 17:19 ` Johannes Schindelin
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-10-16 17:16 UTC (permalink / raw)
To: jari.aalto; +Cc: git, yoshfuji
In article <1192553837-18302-1-git-send-email-jari.aalto@cante.net> (at Tue, 16 Oct 2007 19:57:14 +0300), Jari Aalto <jari.aalto@cante.net> says:
>
> SunOS/Solaris tail(1) does not support option '-n'. The
> following patches change occurrances of:
>
> tail -n <N>
>
> to
>
> tail <N>
You should say "tail -<N>".
--yoshfuji
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] git-commit.sh: Remove option -n from tail
2007-10-16 16:57 ` [PATCH] git-commit.sh: " Jari Aalto
2007-10-16 16:57 ` [PATCH] git-rebase--interactive.sh: " Jari Aalto
@ 2007-10-16 17:18 ` Johannes Schindelin
1 sibling, 0 replies; 10+ messages in thread
From: Johannes Schindelin @ 2007-10-16 17:18 UTC (permalink / raw)
To: Jari Aalto; +Cc: git
Hi,
On Tue, 16 Oct 2007, Jari Aalto wrote:
> Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Rationale?
And also, can't this wait for the builtin-commit, which will solve this
problem?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tail -n not supported in all OSs
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
` (2 preceding siblings ...)
2007-10-16 17:16 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2007-10-16 17:19 ` Johannes Schindelin
2007-10-16 20:37 ` Florian Weimer
2007-10-16 22:06 ` Theodore Tso
5 siblings, 0 replies; 10+ messages in thread
From: Johannes Schindelin @ 2007-10-16 17:19 UTC (permalink / raw)
To: Jari Aalto; +Cc: git
Hi,
On Tue, 16 Oct 2007, Jari Aalto wrote:
>
> SunOS/Solaris tail(1) does not support option '-n'.
This belongs into the commit message.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tail -n not supported in all OSs
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
` (3 preceding siblings ...)
2007-10-16 17:19 ` Johannes Schindelin
@ 2007-10-16 20:37 ` Florian Weimer
2007-10-16 22:06 ` Theodore Tso
5 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2007-10-16 20:37 UTC (permalink / raw)
To: git
* Jari Aalto:
> $ uname -a
> SunOS host 5.9 Generic_118558-35 sun4u sparc SUNW,Serverblade1
>
> $ echo | tail -n 1
>
> usage: tail [+/-[n][lbc][f]] [file]
> tail [+/-[n][l][r|f]] [file]
What about /usr/xpg4/bin/tail? Why aren't you using that?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tail -n not supported in all OSs
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
` (4 preceding siblings ...)
2007-10-16 20:37 ` Florian Weimer
@ 2007-10-16 22:06 ` Theodore Tso
5 siblings, 0 replies; 10+ messages in thread
From: Theodore Tso @ 2007-10-16 22:06 UTC (permalink / raw)
To: Jari Aalto; +Cc: git
On Tue, Oct 16, 2007 at 07:57:14PM +0300, Jari Aalto wrote:
>
> SunOS/Solaris tail(1) does not support option '-n'. The
> following patches change occurrances of:
>
> tail -n <N>
>
> to
>
> tail <N>
POSIX.2 guarantees that "tail -n 2" works. "Tail -<N>" is considered
obsolete. Unfortunately Solaris requires you to use
/usr/xpg4/bin/tail if you want a POSIX.2 compliant header file. The
/usr/bin/tail is designed for System V R3 compliance (i.e., from a
full two decades ago; SVR3 was released in 1987), and is due to Sun's
vow to Backwards Compatible Forever.
See "man 5 standards" on a Solaris box to see how your PATH variable
has to be set if you want something which is compatible with modern
Unix/Linux common usage.
- Ted
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-10-16 22:06 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-16 16:57 [PATCH] tail -n not supported in all OSs Jari Aalto
2007-10-16 16:57 ` [PATCH] git-am.sh: Remove option -n from tail Jari Aalto
2007-10-16 16:57 ` [PATCH] git-commit.sh: " Jari Aalto
2007-10-16 16:57 ` [PATCH] git-rebase--interactive.sh: " Jari Aalto
2007-10-16 17:18 ` [PATCH] git-commit.sh: " Johannes Schindelin
2007-10-16 17:12 ` [PATCH] tail -n not supported in all OSs David Brown
2007-10-16 17:16 ` YOSHIFUJI Hideaki / 吉藤英明
2007-10-16 17:19 ` Johannes Schindelin
2007-10-16 20:37 ` Florian Weimer
2007-10-16 22:06 ` Theodore Tso
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).