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

Git hooks and stdin/stderr/stdout.

From
Gabriel Nützi <gnuetzi@gmail.com>
Date
Oct 11, 2020, 09:25 UTC
Message-ID
<CAA9rTuf4gP5hy2GNubxGmDy_N2R+WoNX99sDUOo-QNym3pB=dQ@mail.gmail.com>
Dear all,

I have a question regarding git hooks and would have liked to get some better understanding of how internally a hook is run. Especially I want to know what happens under the hood because the behavior kind of puzzles me. So what I've understood:

When git runs the hook, git does
- connects stdin of the hook process to it (is that always the case?)
- redirects stdout of  the hook process to the stderr of the hook
process. So anything you write to stdout/stderr in the hook process
ends up in the stderr of the git process.
Is that understanding correct? Is there a doc describing this?
Thanks for the help.
BR Gabriel
Message 1 of 1 in “Git hooks and stdin/stderr/stdout.”
  1. Gabriel NütziOct 11, 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.