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

Re: [PATCH] commit-graph: retain commit slab when closing NULL commit_graph

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 11, 2024, 18:35 UTC
Message-ID
<xmqqedenhg5v.fsf@gitster.g>
In-Reply-To
<20240111075313.GF48154@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> On Wed, Jan 10, 2024 at 08:38:18AM -0800, Junio C Hamano wrote:
>
>> > It should be easy-ish to iterate through the slab and look at the
>> > commits that are mentioned in it. Though maybe not? Each commit knows
>> > its slab-id, but I'm not sure if we have a master list of commits to go
>> > the other way.
>> 
>> We have table of all in-core objects, don't we?
>
> Oh, duh. Yes, we could iterate over obj_hash. I do think the "on demand"
> version I showed later in the message is better, though, as the work
> both scales with the number of affected commits (rather than the total
> number of objects) and can be done lazily (so callers that are not buggy
> pay no price at all).

Yeah, it is far more desirable than scanning obj_hash if we can do the right thing on lazily.

> So what if we just tried harder to look it up in the graph file (rather
> than the slab) when we see COMMIT_NOT_FROM_GRAPH? And indeed, we even
> have a function to do this already!
;-)
> but:
> ...
> I somehow sniped myself into thinking about it more, but that has only
> reinforced my feeling that I'm afraid to touch it. ;)
Thanks for a nice summary.
Previous: Jeff KingNext: Junio C Hamano
Message 6 of 7 in “commit-graph: retain commit slab when closing NULL commit_graph”
  1. commit-graph: retain commit slab when closing NULL commit_graphJeff King, Jan 5, 2024
  2. Taylor BlauJan 5, 2024
  3. Jeff KingJan 10, 2024
  4. Junio C HamanoJan 10, 2024
  5. Jeff KingJan 11, 2024
  6. Junio C HamanoJan 11, 2024
  7. Junio C HamanoJan 5, 2024

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.