Re: [PATCH 1/2] t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/2] t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE

From: Andreas Schwab <hidden>
Date: 2016-06-15 22:47:30

Clemens Buchacher [off-list ref] writes:
Hi,

On Fri, Oct 09, 2009 at 01:39:56PM -0500, Brandon Casey wrote:
quoted
For the Korn shell, $? has the value of the last executed statement
_before_ the call to exit.
I just installed ksh/stable (version 93s+ 2008-01-31) on Debian and it
behaves correctly. Maybe you need to upgrade? This really looks like a bug
in your shell to me.
According to the autoconf docs this bug is also present in the Solaris
/bin/sh (and autoconf generated scripts use some elaborated workaround).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Re: [PATCH 1/2] t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE

From: Ben Walton <hidden>
Date: 2016-06-15 22:47:30

Excerpts from Andreas Schwab's message of Sat Oct 10 08:24:40 -0400 2009:
According to the autoconf docs this bug is also present in the Solaris
/bin/sh (and autoconf generated scripts use some elaborated workaround).
Solaris' /bin/sh shouldn't be used for anything but forking a decent
shell, imo.  It was brought to my attention recently that the test
suite for mercurial on solaris was failing the git tests.  The
mercurial folks initially thought this was a git on solaris bug.

After looking into it, I discovered that ^ is still treated[1] as a
pipe symbol[2] in some cases.  So, test suite programs run under
/bin/sh on solaris with commands like `git reset --hard HEAD^` were
misbehaving due to the shell setting up a pipeline under the right
circumstances.

-Ben

[1] http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/sh/cmd.c
    line 184

[2] This dates back to the Thomson shell:
    http://en.wikipedia.org/wiki/Thompson_shell
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

Re: [PATCH 1/2] t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE

From: Jeff King <hidden>
Date: 2016-06-15 22:47:30

On Sat, Oct 10, 2009 at 08:53:00AM -0400, Ben Walton wrote:
quoted
According to the autoconf docs this bug is also present in the Solaris
/bin/sh (and autoconf generated scripts use some elaborated workaround).
Solaris' /bin/sh shouldn't be used for anything but forking a decent
shell, imo.  It was brought to my attention recently that the test
suite for mercurial on solaris was failing the git tests.  The
mercurial folks initially thought this was a git on solaris bug.
Yes, that is the attitude we take towards /bin/sh on Solaris. Most
people running git on Solaris (or other broken-shell platforms) point
SHELL_PATH to bash. I think the point of Brandon's patch is to let them
use a native shell.

So while /bin/sh is broken, the question is whether the alternate native
shell is broken enough to use or not.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help