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
Mike Ralphson <mike.ralphson@gmail.com>
Date
Jun 4, 2008, 11:40 UTC
Message-ID
<e2b179460806040440m29f2326ek3757660646686623@mail.gmail.com>
In-Reply-To
<E1K1jnV-0007HC-Om@fencepost.gnu.org>
2008/5/29 Paolo Bonzini <bonzini@gnu.org>:
Show 28 quoted lines
>
> Other signals are also common, for example SIGTERM and SIGHUP.
> This patch modifies the lock file mechanism to catch more signals.
> It also modifies http-push.c which was missing SIGTERM.
>
> diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
> index 3531a99..46ec1ce 100755
> --- a/t/t7502-commit.sh
> +++ b/t/t7502-commit.sh
> @@ -212,4 +212,18 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
>        test "`cat .git/result`" = "editor not started"
>  '
>
> +pwd=`pwd`
> +cat > .git/FAKE_EDITOR << EOF
> +#! /bin/sh
> +# kill -TERM command added below.
> +EOF
> +
> +test_expect_success 'a SIGTERM should break locks' '
> +       echo >>negative &&
> +       sh -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
> +'
> +
>  test_done

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.

Happy to test any other suggested fixes.
Mike
Previous: Paolo BonziniNext: Junio C Hamano
Message 8 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.