From: Phillip Wood Date: Fri, 03 Jun 2022 08:51:55 GMT Subject: Re: [PATCH v5 0/2] hook API: connect hooks to the TTY again, fixes a v2.36.0 regression Message-ID: <6e98dfe9-5df2-caab-ed3a-81f07b0bb6bc@gmail.com> In-Reply-To: Hi Ævar On 02/06/2022 15:07, Ævar Arnfjörð Bjarmason wrote: > This series fixes a v2.36.0 regression[1]. See [2] for the v4. The > reasons for why a regression needs this relatively large change to > move forward is discussed in past rounds, e.g. around [3]. CI at > https://github.com/avar/git/actions/runs/2428475773 > > Changes since v4, mainly to address comments by Johannes (thanks for > the review!): > > * First, some things like renaming "ungroup" to something else & > rewriting the tests I didn't do because I thought keeping the > inter/range-diff down in size outweighed re-arranging or changing > the code at this late stage. > > In the case of the suggested shorter test in > https://lore.kernel.org/git/nycvar.QRO.7.76.6.2206011827300.349@tvgsbejvaqbjf.bet/ > the replacement wasn't testing the same thing. I.e. we don't see > what's connected to a TTY if we redirect one of stdout or stderr > anymore, which is important to get right. I'm a bit confused by this, the proposed test uses this hook script write_script .git/hooks/pre-commit <<-EOF test -t 1 && echo "stdout is a TTY" >out test -t 2 && echo "stderr is a TTY" >>out EOF if either of stderr or stdout is redirected then the corresponding "test -t" should fail and so we will detect that it is not a tty. Best Wishes Phillip