From: Junio C Hamano <gitster@pobox.com>
To: "Xiaoguang WANG" <wxiaoguang@gmail.com>,
"Taylor Blau" <me@ttaylorr.com>,
"Torsten Bögershausen" <tboegi@web.de>,
"Chandra Pratap" <chandrapratap3519@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug report: Incorrect GIT_FLUSH behavior in 2.43.1 (regression and breaking)
Date: Mon, 12 Feb 2024 09:11:12 -0800 [thread overview]
Message-ID: <xmqq8r3p7glr.fsf@gitster.g> (raw)
In-Reply-To: <CABn0oJvg3M_kBW-u=j3QhKnO=6QOzk-YFTgonYw_UvFS1NTX4g@mail.gmail.com> (Xiaoguang WANG's message of "Mon, 12 Feb 2024 23:18:38 +0800")
Xiaoguang WANG <wxiaoguang@gmail.com> writes:
> If GIT_FLUSH=true, it should mean to "do the flush". But that commit
> made skip_stdout_flush=true when GIT_FLUSH=true.
Thanks for reporting. I am surprised that this flipping of polarity
slipped through.
> And by the way, only accepting GIT_FLUSH=true is quite breaking, it
> drops the compatibility of GIT_FLUSH=1
I do not think so. If the polarity is corrected, git_env_bool()
would say "that's affirmative" when any one of the "1", "true",
"yes", "on", etc. is given. If you have been passing "1", you
should get the "always flush" behaviour.
Perhaps something like this would fix it?
write-or-die.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git c/write-or-die.c w/write-or-die.c
index 3942152865..3ecb9e2af5 100644
--- c/write-or-die.c
+++ w/write-or-die.c
@@ -22,8 +22,11 @@ void maybe_flush_or_die(FILE *f, const char *desc)
if (f == stdout) {
if (skip_stdout_flush < 0) {
- skip_stdout_flush = git_env_bool("GIT_FLUSH", -1);
- if (skip_stdout_flush < 0) {
+ int flush_setting = git_env_bool("GIT_FLUSH", -1);
+
+ if (0 <= flush_setting)
+ skip_stdout_flush = !flush_setting;
+ else {
struct stat st;
if (fstat(fileno(stdout), &st))
skip_stdout_flush = 0;
next prev parent reply other threads:[~2024-02-12 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 15:18 Bug report: Incorrect GIT_FLUSH behavior in 2.43.1 (regression and breaking) Xiaoguang WANG
2024-02-12 17:11 ` Junio C Hamano [this message]
2024-02-12 17:18 ` Xiaoguang WANG
2024-02-13 11:07 ` Phillip Wood
2024-02-13 17:26 ` Junio C Hamano
2024-02-13 19:48 ` Junio C Hamano
2024-02-14 10:57 ` Phillip Wood
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq8r3p7glr.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chandrapratap3519@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=tboegi@web.de \
--cc=wxiaoguang@gmail.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.
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 NNTP newsgroup(s).