Thread (4 messages) 4 messages, 2 authors, 2022-11-28

Re: [PATCH] t5516: fail to run in verbose mode

From: Jeff King <hidden>
Date: 2022-11-24 01:16:10

On Wed, Nov 23, 2022 at 10:17:29AM +0900, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help