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

git does not wait on hook exes (^C)

From
Anthony Sottile <asottile@umich.edu>
Date
Feb 20, 2020, 21:14 UTC
Message-ID
<CA+dzEB=jJEkuvcX5qDfeXS=mbJu_m=-yUsmHd_KrKAXC3YDe7w@mail.gmail.com>
Here's a small example:
```bash
#!/usr/bin/env bash
foo() {
    echo zzz part 2
    sleep 1
    echo exiting now
}
trap foo SIGINT

echo zzz part 1 sleep 10 ```

```console $ git --version git version 2.25.GIT $ git commit --allow-empty -m foo zzz part 1 ^Czzz part 2

$ exiting now ```

- I pressed ^C during the first sleep
- control was returned back to my terminal
- the hook script was still running in the background
Anthony
Next: brian m. carlson
Message 1 of 8 in “git does not wait on hook exes (^C)”
  1. Anthony SottileFeb 20, 2020
  2. brian m. carlsonFeb 21, 2020
  3. Anthony SottileFeb 21, 2020
  4. brian m. carlsonFeb 21, 2020
  5. Anthony SottileFeb 21, 2020
  6. brian m. carlsonFeb 21, 2020
  7. Jeff KingFeb 21, 2020
  8. Anthony SottileFeb 21, 2020

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.