Re: bug report: pre-push hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 24, 2022 at 2:29 PM Taylor Blau <me@xxxxxxxxxxxx> wrote:
>
> On Thu, Mar 24, 2022 at 11:30:16AM -0700, Emily Shaffer wrote:
> > > 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.

Ah, it seems I'm completely mistaken :) Sorry for the misinfo. Urk.

Having a look in 'master', run_pre_push_hook() does not use hook.c
machinery yet at all; it also seems like it doesn't try to capture
stdout from the pre-push child process anyways. That makes me ask "how
did this ever work?" which brings me back to wanting a small hook we
can try to reproduce with from Honza :)

 - Emily



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux