git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Nov 24, 2022, 01:16 UTC
Message-ID
<Y37F1nxifC8o8qEQ@coredump.intra.peff.net>
In-Reply-To
<xmqqwn7mo4eu.fsf@gitster.g>
On Wed, Nov 23, 2022 at 10:17:29AM +0900, Junio C Hamano wrote:
Show 17 quoted lines
> Jeff King <peff@peff.net> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “t5516: fail to run in verbose mode”
  1. t5516: fail to run in verbose modeJiang Xin, Nov 21, 2022
  2. kylezhao (赵柯宇)Nov 22, 2022
  3. Junio C HamanoNov 22, 2022
  4. Jeff KingNov 22, 2022
  5. Junio C HamanoNov 23, 2022
  6. Jeff KingNov 24, 2022
  7. Junio C HamanoNov 25, 2022
  8. Jeff KingNov 28, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.