git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] rollback lock files on more signals than just SIGINT

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2008, 17:29 UTC
Message-ID
<7vhcc9xg5j.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<e2b179460806040440m29f2326ek3757660646686623@mail.gmail.com>
"Mike Ralphson" <mike.ralphson@gmail.com> writes:
Show 6 quoted lines
> 2008/5/29 Paolo Bonzini <bonzini@gnu.org>:
> ...
> 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-<editor>.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
Previous: Mike RalphsonNext: Mike Ralphson
Message 9 of 10 in “rollback index if git-commit is interrupted by a signal”
  1. rollback index if git-commit is interrupted by a signalPaolo Bonzini, May 29, 2008
  2. Johannes SchindelinMay 29, 2008
  3. Paolo BonziniMay 29, 2008
  4. Johannes SchindelinMay 29, 2008
  5. Paolo BonziniMay 29, 2008
  6. Johannes SchindelinMay 29, 2008
  7. rollback lock files on more signals than just SIGINTPaolo Bonzini, May 29, 2008
  8. Mike RalphsonJun 4, 2008
  9. Junio C HamanoJun 4, 2008
  10. Mike RalphsonJun 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.