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

Re: [PATCH 1/1] fetch: add fetch.writeCommitGraph config setting

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 6, 2019, 21:46 UTC
Message-ID
<xmqqlfv1m72p.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<d550ac23-cb65-b547-d9dc-1428ee2e9420@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 19 quoted lines
>>> +		write_commit_graph_reachable(get_object_directory(),
>>> +					     commit_graph_flags,
>>> +					     &split_opts);
>>> +	}
>> 
>> As a low-impact change this is good.  
>> 
>> For longer term, it feels a bit unfortunate that this is still a
>> separate phase of the program, though.  We know what new refs we
>> added, we know what new objects we received, and we even scanned
>> each and every one of them while running the index-pack step to
>> store the .pack and compute the .idx file, i.e. it feels that we
>> have most of the information already in-core to extend the commit
>> graph for new parts of the history we just received.
>
> You're right that we could isolate the new write to the refs we
> just received. We could use the more cumbersome write_commit_graph()
> method with a list of commit oids as starting points. I'm happy to
> make that change if we see a lot of value there.
Well, that is not the kind of information reuse I am talking about.

I was wondering if "index-pack" has enough information in-core after it receives and processes the incoming pack data, scanned each and every object in it, in order to write out the commit graph _without_ having to do a lot of duplicate computation and enumeration of the objects done in the current commit-graph.c::write_commit_graph(), so that it can learn a "--write-commit-graph" option that performs much better than running "git fetch && git commit-graph write".

Perhaps that would require too much refactoring of both index-pack and commit-graph code and infeasible in short to medium term and that is why I said "for longer term, it feels a bit unfortunate".

Thanks.
Previous: Derrick StoleeNext: Jeff King
Message 5 of 18 in “Write commit-graph on fetch”
  1. 0/1 Write commit-graph on fetchDerrick Stolee via GitGitGadget, Sep 3, 2019
  2. 1/1 fetch: add fetch.writeCommitGraph config settingDerrick Stolee via GitGitGadget, Sep 3, 2019
  3. Junio C HamanoSep 3, 2019
  4. Derrick StoleeSep 3, 2019
  5. Junio C HamanoSep 6, 2019
  6. Jeff KingSep 7, 2019
  7. Junio C HamanoSep 9, 2019
  8. Jeff KingSep 4, 2019
  9. Junio C HamanoSep 5, 2019
  10. Derrick StoleeSep 6, 2019
  11. Jeff KingSep 6, 2019
  12. Junio C HamanoSep 6, 2019
  13. Jeff KingSep 6, 2019
  14. Junio C HamanoSep 6, 2019
  15. Derrick StoleeSep 6, 2019
  16. Junio C HamanoSep 6, 2019
  17. Jeff KingSep 7, 2019
  18. Jeff KingSep 7, 2019

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.