From: Jeff King <peff@peff.net>
To: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Git mailing list <git@vger.kernel.org>,
Patrick Steinhardt <ps@pks.im>,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Subject: Re: [PATCH v3] builtin/history: unuse the commit buffer after use
Date: Thu, 10 Sep 2026 12:02:54 -0400 [thread overview]
Message-ID: <20260910160254.GB251185@coredump.intra.peff.net> (raw)
In-Reply-To: <20260910150021.348548-1-kaartic.sivaraam@gmail.com>
On Thu, Sep 10, 2026 at 08:30:15PM +0530, Kaartic Sivaraam wrote:
> Changes since v2:
>
> - Tried to improve the commit message to make it more readable (hopefully).
Thanks, the patch looks good and I think the commit message is accurate.
I probably would have written something much shorter, like:
Every call to repo_logmsg_reencode() must be paired with a call to
repo_unuse_commit_buffer(), or we may leak an allocated buffer. We
have such a leak in "git history", which we can fix by adding an unuse
call.
The leak-checking tests don't detect this because we only allocate a
fresh buffer sometimes: when the message is reencoded, or when we had
to load it fresh from the odb (e.g., because the commit was parsed
from the commit graph rather than the object contents). But you can
see it by running:
make SANITIZE=leak
cd t
GIT_TEST_COMMIT_GRAPH=1 ./t3451-history-reword.sh
I'm not suggesting a v3 with this wording, as I think there are
diminishing returns to polishing commit messages forever. Mostly just
food for thought for future patches. :)
-Peff
next prev parent reply other threads:[~2026-09-10 16:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-14 14:15 [PATCH] builtin/history: unuse the commit buffer after use Kaartic Sivaraam
2026-06-15 9:48 ` Patrick Steinhardt
2026-06-15 17:29 ` Jeff King
2026-06-16 5:45 ` Patrick Steinhardt
2026-06-30 3:45 ` Kaartic Sivaraam
2026-06-30 5:26 ` Jeff King
2026-06-30 3:43 ` Kaartic Sivaraam
2026-06-30 5:38 ` Jeff King
2026-06-30 5:50 ` Jeff King
2026-06-30 6:44 ` Jeff King
2026-09-10 11:39 ` [PATCH v2] " Kaartic Sivaraam
2026-09-10 13:36 ` Junio C Hamano
2026-09-10 15:00 ` [PATCH v3] " Kaartic Sivaraam
2026-09-10 16:02 ` Jeff King [this message]
2026-09-10 16:20 ` Junio C Hamano
2026-09-10 16:37 ` Kaartic Sivaraam
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=20260910160254.GB251185@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kaartic.sivaraam@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=ps@pks.im \
/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