From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: Re: [PATCH 0/6] getwholeline should clear the buffer upon EOF
Date: Mon, 23 Nov 2026 07:37:18 -0800 [thread overview]
Message-ID: <xmqq4id7d0ep.fsf@gitster.g> (raw)
In-Reply-To: <20261122140347.41990-1-gitster@pobox.com> (Junio C. Hamano's message of "Sun, 22 Nov 2026 06:03:41 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> time. Because the code that caused the existing bugs does not appear in
> any of these steps, the log messages of patches 2-4 instead give
> detailed walkthroughs and are rather long, which is another reason why
> the nature of this series discourages following the usual pattern and
> doing everything in one step.
By the way, I _could_ have instead called strbuf_reset() at strategic
places in patches 2-4 to "fix" the bug without touching the root cause,
i.e., strbuf_getwholeline(), and added test_expect_success tests. That
way, the commit log messages for these steps did not have to be such a
detailed walkthrough of how the bugs happen, simply because the code
that make problematic decisions based on a wrong assumption can be read
in the context of these changes. Which requires patch 5 that fixes the
root cause to revert these tentative "fixes" to call strbuf_reset()
which becomes unnecessary when strbuf_getwholeline() stops leaving the
stale contents in the buffer upon feof().
I chose not to do so, as a series that adds some code in an early step
and immediately removes the same code in a later step is awkward and
wasteful.
prev parent reply other threads:[~2026-11-23 15:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 14:03 [PATCH 0/6] getwholeline should clear the buffer upon EOF Junio C Hamano
2026-11-22 14:03 ` [PATCH 1/6] mailinfo: do not call handle_body() when headers end at EOF Junio C Hamano
2026-11-22 14:03 ` [PATCH 2/6] t4201: demonstrate shortlog reusing stale buffer on EOF Junio C Hamano
2026-11-22 14:03 ` [PATCH 3/6] t7301: demonstrate "clean -i" ask mode deleting past EOF Junio C Hamano
2026-11-22 14:03 ` [PATCH 4/6] t9300: demonstrate fast-import re-parsing heredoc delimiter at EOF Junio C Hamano
2026-11-22 14:03 ` [PATCH 5/6] strbuf_getwholeline(): clear strbuf upon EOF Junio C Hamano
2026-11-22 14:03 ` [PATCH 6/6] t7301, t9300: test EOF loops fixed by clearing " Junio C Hamano
2026-11-23 15:37 ` Junio C Hamano [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4id7d0ep.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/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