Re: git 2.36.0 regression: pre-commit hooks no longer have stdout/stderr as tty
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2022, 04:23 UTC
- Message-ID
- <xmqqy200s7r7.fsf@gitster.g>
- In-Reply-To
- <CA+dzEBn108QoMA28f0nC8K21XT+Afua0V2Qv8XkR8rAeqUCCZw@mail.gmail.com>
Anthony Sottile <asottile@umich.edu> writes:
Show 9 quoted lines
> here's the shortest reproduction -- > > ```console > $ cat ../testrepo/.git/hooks/pre-commit > #!/usr/bin/env bash > if [ -t 1 ]; then > echo GOOD > fi > ```
Show 18 quoted lines
> f443246b9f29b815f0b98a07bb2d425628ae6522 is the first bad commit
> commit f443246b9f29b815f0b98a07bb2d425628ae6522
> Author: Emily Shaffer <emilyshaffer@google.com>
> 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 <emilyshaffer@google.com>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> Acked-by: Emily Shaffer <emilyshaffer@google.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> commit.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
> bisect run successNicely 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.