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

[PATCH 0/1] Write commit-graph on fetch

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 3, 2019, 02:22 UTC
Message-ID
<pull.328.git.gitgitgadget@gmail.com>

Instead of waiting for a non-trivial GC command to write the commit-graph, write one during 'git fetch'. By using the equivalent method for 'git commit-graph write --split --reachable', we create a commit-graph chain that includes all reachable commits. Most of the time, these writes only add the newly-downloaded commits in a small file at the top of the commit-graph chain. Commits that are no longer reachable still exist in the commit-graph, but will be cleaned up by a later GC command that forces the commit-graph to be rewritten completely.

A version of this patch [1] used to be a part of ds/commit-graph-incremental, but was removed to focus on the incremental commit-graph file format. Now that the incremental file format has been shipped in v2.23.0 and some config things have adjusted in ds/feature-macros, I'm reintroducing the idea.

Ævar had mentioned wanting to do something with "incremental maintenance during GC" [2]. I haven't seen any patches towards that aim (please point me in that direction if they have been submitted). I still think it is worth allowing a write at fetch time, as some users have GC disabled. I know for sure that users who only interact with their Git repos via Visual Studio Team Explorer have all Git commands running with GC disabled, and likely other desktop GUI clients have it disabled to avoid blocking processes.

Aside: VFS for Git users have GC disabled, but the commit-graph is being
written in the background by a monitoring process. We shipped the
incremental commit-graph writes in a recent version and reduced our writes
from ~60 seconds each to less than a second on average. Very rarely, the
layers of the commit-graph chain collapse and return to the old values. This
feature has been performing well with no known issues.
Thanks, -Stolee

[1] https://public-inbox.org/git/3c52385e5696887c40cab4a6b9b7923d60a0567c.1557330827.git.gitgitgadget@gmail.com/

[2] https://public-inbox.org/git/b1de6af2-c015-098e-a656-e1b68056e037@gmail.com/

Derrick Stolee (1):
  fetch: add fetch.writeCommitGraph config setting
 Documentation/config/feature.txt |  8 ++++++++
 Documentation/config/fetch.txt   | 10 ++++++++++
 builtin/fetch.c                  | 15 +++++++++++++++
 repo-settings.c                  |  4 ++++
 repository.h                     |  1 +
 t/t5510-fetch.sh                 | 13 +++++++++++++
 6 files changed, 51 insertions(+)
base-commit: aaf633c2ad10b47af7623c130ddfe7231658c7e4
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-328%2Fderrickstolee%2Ffetch-write-commit-graph-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-328/derrickstolee/fetch-write-commit-graph-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/328
-- 
gitgitgadget
Next: Derrick Stolee via GitGitGadget
Message 1 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.