From: Junio C Hamano Date: Wed, 04 Jun 2008 17:29:28 GMT Subject: Re: [PATCH v2] rollback lock files on more signals than just SIGINT Message-ID: <7vhcc9xg5j.fsf@gitster.siamese.dyndns.org> In-Reply-To: "Mike Ralphson" writes: > 2008/5/29 Paolo Bonzini : > ... > This addition to the testsuite breaks it on AIX with the default sh > (ksh). Replacing the explicit sh -c with $SHELL_PATH -c fixes it for > me (as I have SHELL_PATH pointing to bash). If that's acceptable I can > post a patch if necessary. Like the attached one? I noticed quite a many "sh" dependencies in other test scripts: - t0021: rot13.sh does not begin with "#!$SHELL_PATH" nor any "#!" - t6026: custom-merge begins with "#!/bin/sh", not "#!$SHELL_PATH". - t6030: test_script.sh begins with "#!/bin/sh", not "#!$SHELL_PATH". - t7005: e-.sh do not begin with "#!$SHELL_PATH" nor any "#!" - t7402: fake-editor.sh begins with "#!/bin/sh", not "#!$SHELL_PATH". - t7502: you noticed - t9100: exec.sh begins with "#!/bin/sh", not "#!$SHELL_PATH". I presume most of the scripts the above incorrectly feeds to "sh" not to the shell you specify are plain vanilla scripts that not-quite-POSIX shells can grok them, so in practice this may not be a problem, but we should eventually fix them. t/t7502-commit.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh index a5801df..f43c1b1 100755 --- a/t/t7502-commit.sh +++ b/t/t7502-commit.sh @@ -217,14 +217,14 @@ test_expect_success 'do not fire editor in the presence of conflicts' ' ' pwd=`pwd` -cat > .git/FAKE_EDITOR << EOF -#! /bin/sh +cat >.git/FAKE_EDITOR <<"EOF" +#! $SHELL_PATH # kill -TERM command added below. EOF test_expect_success 'a SIGTERM should break locks' ' echo >>negative && - sh -c '\'' + "$SHELL_PATH" -c '\'' echo kill -TERM $$ >> .git/FAKE_EDITOR GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1 # should fail ! test -f .git/index.lock