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

Re: [PATCH 1/2] builtin/repo: only parse objects as needed

From
Kristofer Karlsson <krka@spotify.com>
Date
Nov 16, 2026, 09:02 UTC
Message-ID
<CAL71e4MKmEsP9xsZ7eg_LOFSCiwOjVU9H=rvOYkOFXV=3rMPxw@mail.gmail.com>
In-Reply-To
<avqk_DfxW1uKFXi7@pks.im>
On Mon, 16 Nov 2026 at 07:38, Patrick Steinhardt <ps@pks.im> wrote:
Show 14 quoted lines
>
> On Fri, Nov 13, 2026 at 03:12:19PM +0100, Kristofer Karlsson wrote:
> > On Fri, 13 Nov 2026 at 13:50, Patrick Steinhardt <ps@pks.im> wrote:
>
> > Tiny nit: I understood the comment as saying that the code
> > depends on the commits being parsed already, but
> > repo_parse_commit() handles the case where they are not.
> > Since path-walk hands us commits from get_revision(), I
> > assume that is only a failsafe?  So this is just about the
> > phrasing.  How about:
>
> Yeah, it is. I was wondering whether I want to call `BUG()` here in the
> case where the commit cannot be parsed, as that case really shouldn't
> ever happen. But that felt a bit heavy-handed to me.

I think it would be a valid option, as long as their is enough test coverage. If there's ever a regression here that makes this function be called for commits that have not been loaded, the current implementation would mean surviving it, but at the cost of extra unintentional work, whereas a BUG() assert would make the regression more obvious.

It's not something I have a strong opinion on though, and I think the updated comment will make future developers see what the intention is.

Thanks, Kristofer

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 5 of 15 in “builtin/repo: improve counting of objects”
  1. 0/2 builtin/repo: improve counting of objectsPatrick Steinhardt, Nov 13, 2026
  2. 1/2 builtin/repo: only parse objects as neededPatrick Steinhardt, Nov 13, 2026
  3. Kristofer KarlssonNov 13, 2026
  4. Patrick SteinhardtNov 16, 2026
  5. Kristofer KarlssonNov 16, 2026
  6. 2/2 builtin/repo: don't fully parse treesPatrick Steinhardt, Nov 13, 2026
  7. Kristofer KarlssonNov 13, 2026
  8. Patrick SteinhardtNov 16, 2026
  9. Derrick StoleeNov 16, 2026
  10. 0/2 builtin/repo: improve counting of objectsPatrick Steinhardt, Nov 16, 2026
  11. 1/2 builtin/repo: only parse objects as neededPatrick Steinhardt, Nov 16, 2026
  12. 2/2 builtin/repo: don't fully parse treesPatrick Steinhardt, Nov 16, 2026
  13. Kristofer KarlssonNov 16, 2026
  14. Derrick StoleeNov 16, 2026
  15. Junio C HamanoNov 16, 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.