Skip to content

RFC Integrate commit-graph into 'fsck' and 'gc'

Derrick Stolee git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12fixup! commit-graph: always load commit-graph informationcommit-graph.c+1 -10 replies
1/12commit-graph: add 'verify' subcommandDocumentation/git-commit-graph.txt builtin/commit-graph.c commit-graph.c +2 more+61 -01 reply
2/12commit-graph: add 'check' subcommandDocumentation/git-commit-graph.txt builtin/commit-graph.c commit-graph.c +2 more+56 -11 reply
2/12commit-graph: verify file header informationcommit-graph.c+22 -11 reply
3/12commit-graph: check file header informationcommit-graph.c+28 -11 reply
3/12commit-graph: parse commit from chosen graphcommit-graph.c+15 -30 replies
4/12commit-graph: parse commit from chosen graphcommit-graph.c+14 -41 reply
4/12commit-graph: verify fanout and lookup tablecommit-graph.c+33 -02 replies
5/12commit-graph: check fanout and lookup tablecommit-graph.c+34 -01 reply
5/12commit: force commit to parse from object databasecommit.c commit.h+10 -40 replies
6/12commit: force commit to parse from object databasecommit.c commit.h+11 -41 reply
6/12commit-graph: load a root tree from specific graphcommit-graph.c+8 -20 replies
7/12commit-graph: load a root tree from specific graphcommit-graph.c+8 -21 reply
7/12commit-graph: verify commit contents against odbcommit-graph.c+88 -00 replies
8/12commit-graph: verify commit contents against odbcommit-graph.c+82 -01 reply
8/12fsck: verify commit-graphDocumentation/git-fsck.txt builtin/fsck.c t/t5318-commit-graph.sh+29 -00 replies
9/12fsck: check commit-graphbuiltin/fsck.c+13 -01 reply
9/12commit-graph: add '--reachable' optionDocumentation/git-commit-graph.txt builtin/commit-graph.c t/t5318-commit-graph.sh+53 -60 replies
10/12commit-graph: add '--reachable' optionDocumentation/git-commit-graph.txt builtin/commit-graph.c t/t5318-commit-graph.sh+53 -61 reply
10/12gc: automatically write commit-graph filesDocumentation/config.txt Documentation/git-gc.txt builtin/gc.c+18 -00 replies
11/12gc: automatically write commit-graph filesDocumentation/git-gc.txt builtin/gc.c+12 -02 replies
11/12fetch: compute commit-graph by defaultDocumentation/config.txt builtin/fetch.c+17 -00 replies
12/12commit-graph: update design documentDocumentation/technical/commit-graph.txt+0 -91 reply
12/12commit-graph: update design documentDocumentation/technical/commit-graph.txt+0 -220 replies

Reviews trailers per patch

None of the 24 patches has a Reviewed-by or Acked-by.

PatchMartin Ågren
SeriesHelped-by
1/12
1/12
2/12
2/12
3/12
3/12
4/12
4/12
5/12
5/12
6/12
6/12
7/12
7/12
8/12
8/12
9/12
9/12
10/12
10/12
11/12
11/12
12/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/12] Integrate commit-graph into 'fsck' and 'gc'

The commit-graph feature is not useful to end users until the commit-graph file is maintained automatically by Git during normal upkeep operations. One natural place to trigger this write is during 'git gc'.

Before automatically generating a commit-graph, we need to be able to verify the contents of a commit-graph file. Integrate commit-graph checks into 'fsck' that check the commit-graph contents against commits in the object database.

Things to think about:

* Are these the right integration points?

* gc.commitGraph defaults to true right now for the purpose of testing, but may not be required to start. The goal is to have this default to true eventually, but we may want to delay that until the feature is stable.

* I implement a "--reachable" option to 'git commit-graph write' that iterates over all refs. This does the same as

	git show-ref -s | git commit-graph write --stdin-commits

but I don't know how to pipe two child processes together inside of Git. Perhaps this is a better solution, anyway.

What other things should I be considering in this case? I'm unfamiliar with the inner-workings of 'fsck' and 'gc', so this is a new space for me.

This RFC is based on v3 of ds/generation-numbers, and the first commit is a fixup! based on a bug in that version that I caught while prepping this series.

Thanks,
-Stolee

Derrick Stolee (12):
fixup! commit-graph: always load commit-graph information
commit-graph: add 'check' subcommand
commit-graph: check file header information
commit-graph: parse commit from chosen graph
commit-graph: check fanout and lookup table
commit: force commit to parse from object database
commit-graph: load a root tree from specific graph
commit-graph: verify commit contents against odb
fsck: check commit-graph
commit-graph: add '--reachable' option
gc: automatically write commit-graph files
commit-graph: update design document

 Documentation/git-commit-graph.txt       |  15 +-
 Documentation/git-gc.txt                 |   4 +
 Documentation/technical/commit-graph.txt |   9 --
 builtin/commit-graph.c                   |  79 +++++++++-
 builtin/fsck.c                           |  13 ++
 builtin/gc.c                             |   8 +
 commit-graph.c                           | 178 ++++++++++++++++++++++-
 commit-graph.h                           |   2 +
 commit.c                                 |  14 +-
 commit.h                                 |   1 +
 t/t5318-commit-graph.sh                  |  15 ++
 11 files changed, 311 insertions(+), 27 deletions(-)
Signature · 1 line
2.17.0.39.g685157f7fb