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

Re: bug report: pre-push hook

From
Taylor Blau <me@ttaylorr.com>
Date
Mar 24, 2022, 21:29 UTC
Message-ID
<Yjziu8nU/SZ7SyH0@nand.local>
In-Reply-To
<CAJoAoZmo4bJgGdYQeM4XtRJHOpm4z7Gvg=qpUc4xa7Ap=v++UA@mail.gmail.com>
On Thu, Mar 24, 2022 at 11:30:16AM -0700, Emily Shaffer wrote:
Show 6 quoted lines
> > What happened instead? (Actual behavior)
> > Tests seem to execute on the background, but I do not see output
>
> I wonder - are you printing your test output to stdout, or stderr?
> stderr of the hook is printed to stdout of the Git process, so that
> may be why.

I didn't think that we redirected the pre-push (or any) hook's stderr to stdout in the parent process. I wrote a small pre-push hook which is just:

    $ cat .git/hooks/pre-push
    #!/bin/sh
    echo >&2 "hi!"
and then:
    $ git.compile push ttaylorr --dry-run 2>foo
    $ grep hi foo
    hi!

But I might be holding it wrong, since I am not a frequent user of hooks.

Thanks, Taylor

Previous: Emily ShafferNext: Emily Shaffer
Message 3 of 4 in “bug report: pre-push hook”
  1. Honza ProkešMar 24, 2022
  2. Emily ShafferMar 24, 2022
  3. Taylor BlauMar 24, 2022
  4. Emily ShafferMar 24, 2022

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.