git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jiang Xin <worldhello.net@gmail.com>,
	Taylor Blau <me@ttaylorr.com>, Git List <git@vger.kernel.org>,
	Kyle Zhao <kylezhao@tencent.com>,
	Jiang Xin <zhiyou.jx@alibaba-inc.com>
Subject: Re: [PATCH] t5516: fail to run in verbose mode
Date: Mon, 28 Nov 2022 00:13:52 -0500	[thread overview]
Message-ID: <Y4RDkGZE3cZFS25d@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqzgcfeik0.fsf@gitster.g>

On Fri, Nov 25, 2022 at 01:58:55PM +0900, Junio C Hamano wrote:

> 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

      reply	other threads:[~2022-11-28  5:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 13:40 [PATCH] t5516: fail to run in verbose mode Jiang Xin
2022-11-22  2:22 ` [Internet][PATCH] " kylezhao(赵柯宇)
2022-11-22  4:19 ` [PATCH] " Junio C Hamano
2022-11-22 19:08   ` Jeff King
2022-11-23  1:17     ` Junio C Hamano
2022-11-24  1:16       ` Jeff King
2022-11-25  4:58         ` Junio C Hamano
2022-11-28  5:13           ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4RDkGZE3cZFS25d@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kylezhao@tencent.com \
    --cc=me@ttaylorr.com \
    --cc=worldhello.net@gmail.com \
    --cc=zhiyou.jx@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).