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 28, 2022, 05:13 UTC
Message-ID
<Y4RDkGZE3cZFS25d@coredump.intra.peff.net>
In-Reply-To
<xmqqzgcfeik0.fsf@gitster.g>
On Fri, Nov 25, 2022 at 01:58:55PM +0900, Junio C Hamano wrote:
Show 12 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > 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.
> 
> We could pipe to "dd bs=1 conv=fsync" (tongue-in-cheek---I think
> conv=fsync is a GNU thing).

We don't need the fsync; we are just worried about in-process buffering, not kernel-level flushing. So bs=1 is sufficient, in that it would use syscalls to read/write single bytes. It would just be horribly inefficient.

We really just want immediate partial read()/write() but with sensible buffer sizes. It would be easy to write a 5-line C program that did this if we really wanted to. I'm not entirely convinced it's worth worrying too much about, though.

-Peff
Previous: Junio C Hamano
Message 8 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.