git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] builtin/history: unuse the commit buffer after use

From
Jeff King <peff@peff.net>
Date
Sep 10, 2026, 16:02 UTC
Message-ID
<20260910160254.GB251185@coredump.intra.peff.net>
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
Previous: Kaartic SivaraamNext: Junio C Hamano
Message 14 of 17 in “builtin/history: unuse the commit buffer after use”
  1. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Jun 14, 2026
  2. Patrick SteinhardtJun 15, 2026
  3. Jeff KingJun 15, 2026
  4. Patrick SteinhardtJun 16, 2026
  5. Kaartic SivaraamJun 30, 2026
  6. Jeff KingJun 30, 2026
  7. Kaartic SivaraamJun 30, 2026
  8. Jeff KingJun 30, 2026
  9. Jeff KingJun 30, 2026
  10. Jeff KingJun 30, 2026
  11. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Sep 10, 2026
  12. Junio C HamanoSep 10, 2026
  13. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Sep 10, 2026
  14. Jeff KingSep 10, 2026
  15. Junio C HamanoSep 10, 2026
  16. Kaartic SivaraamSep 10, 2026
  17. builtin/history: unuse the commit buffer after useKaartic Sivaraam, Sep 15, 2026

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.