On Wed, Nov 23, 2022 at 10:17:29AM +0900, Junio C Hamano wrote: > Jeff King <peff@xxxxxxxx> writes: > > > I agree this is a good fix for now, but I wonder philosophically what it > > means. That is, I could see two arguments: > > > > 1. Our tests sometimes run with stderr connected to a tty and > > sometimes not. This means the test environment isn't consistent, > > and perhaps we should be piping all "-v" tests through "cat" or > > something so that the environment is stable. > > Yes, this is tempting (and I almost brought it up in my response), > and a pipe to "|cat" may be hopefully closer than tester's tty to > the redirection to "/dev/null". I didn't know how much closer, > though, and the differences may still matter (we could teach "git > grep" or "git diff --exit-code" to notice that the output is sent to > /dev/null and stop at the first hit, for example), but still "|cat" > is closer than ">/dev/tty". One thing I'd worry about is buffering. One of the nice things about "-v" is that there is nothing between you and the running programs, so you are much less likely to be fooled about the order of events in the output. Or wondering why nothing is happening because real-time output seems to have stalled. But piping through "cat" may end up with weird pauses while it fills up a 4k buffer. Using stdbuf could help, but that's far from portable. -Peff