Subject: Re: git 2.36.0 regression: pre-commit hooks no longer have stdout/stderr as tty

From: Junio C Hamano <[email-masked]>
Date: Tue, 19 Apr 2022 21:23:24 -0700

Anthony Sottile <[email-masked]> writes:

> here's the shortest reproduction --
>
> ```console
> $ cat ../testrepo/.git/hooks/pre-commit
> #!/usr/bin/env bash
> if [ -t 1 ]; then
>     echo GOOD
> fi
> ```

> f443246b9f29b815f0b98a07bb2d425628ae6522 is the first bad commit
> commit f443246b9f29b815f0b98a07bb2d425628ae6522
> Author: Emily Shaffer <[email-masked]>
> Date:   Wed Dec 22 04:59:40 2021 +0100
>
>     commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
>
>     Move these hooks hook away from run-command.h to and over to the new
>     hook.h library.
>
>     Signed-off-by: Emily Shaffer <[email-masked]>
>     Signed-off-by: Ævar Arnfjörð Bjarmason <[email-masked]>
>     Acked-by: Emily Shaffer <[email-masked]>
>     Signed-off-by: Junio C Hamano <[email-masked]>
>
>  commit.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> bisect run success

Nicely bisected.  Thanks.

I have a feeling that it may have been a deliberate design decision
when Ævar revamped the code that drives the hook invocation based on
Emily's code.  Ævar, Emily, do any of you remember why we did this,
or is this a mere regression?

Thanks.