@@ -513,9 +513,17 @@ <h1>Git Commit-Graph Design Notes</h1>
513513< p > Values 1-4 satisfy the requirements of parse_commit_gently().</ p >
514514</ div >
515515< div class ="paragraph ">
516- < p > There are two definitions of generation number:
517- 1. Corrected committer dates (generation number v2)
518- 2. Topological levels (generation number v1)</ p >
516+ < p > There are two definitions of generation number:</ p >
517+ </ div >
518+ < div class ="olist arabic ">
519+ < ol class ="arabic ">
520+ < li >
521+ < p > Corrected committer dates (generation number v2)</ p >
522+ </ li >
523+ < li >
524+ < p > Topological levels (generation number v1)</ p >
525+ </ li >
526+ </ ol >
519527</ div >
520528< div class ="paragraph ">
521529< p > Define "corrected committer date" of a commit recursively as follows:</ p >
@@ -683,11 +691,8 @@ <h2 id="_commit_graphs_chains">Commit-Graphs Chains</h2>
683691we enable fast writes of new commit data without rewriting the entire commit
684692history — at least, most of the time.</ p >
685693</ div >
686- </ div >
687- </ div >
688- < div class ="sect1 ">
689- < h2 id ="_file_layout "> File Layout</ h2 >
690- < div class ="sectionbody ">
694+ < div class ="sect2 ">
695+ < h3 id ="_file_layout "> File Layout</ h3 >
691696< div class ="paragraph ">
692697< p > A commit-graph chain uses multiple files, and we use a fixed naming convention
693698to organize these files. Each commit-graph file has a name
@@ -702,9 +707,9 @@ <h2 id="_file_layout">File Layout</h2>
702707</ div >
703708< div class ="listingblock ">
704709< div class ="content ">
705- < pre class =" highlight " > < code > {hash0}
710+ < pre > {hash0}
706711 {hash1}
707- {hash2}</ code > </ pre >
712+ {hash2}</ pre >
708713</ div >
709714</ div >
710715< div class ="paragraph ">
@@ -751,10 +756,8 @@ <h2 id="_file_layout">File Layout</h2>
751756{hash0} and {hash1}.</ p >
752757</ div >
753758</ div >
754- </ div >
755- < div class ="sect1 ">
756- < h2 id ="_merging_commit_graph_files "> Merging commit-graph files</ h2 >
757- < div class ="sectionbody ">
759+ < div class ="sect2 ">
760+ < h3 id ="_merging_commit_graph_files "> Merging commit-graph files</ h3 >
758761< div class ="paragraph ">
759762< p > If we only added a new commit-graph file on every write, we would run into a
760763linear search problem through many commit-graph files. Instead, we use a merge
@@ -769,31 +772,31 @@ <h2 id="_merging_commit_graph_files">Merging commit-graph files</h2>
769772</ div >
770773< div class ="literalblock ">
771774< div class ="content ">
772- < pre > +---------------------+
773- | |
774- | (new commits) |
775- | |
776- +---------------------+
777- | |
778- +-----------------------+ +---------------------+
779- | graph-{hash2} |->| |
780- +-----------------------+ +---------------------+
781- | | |
782- +-----------------------+ +---------------------+
783- | | | |
784- | graph-{hash1} |->| |
785- | | | |
786- +-----------------------+ +---------------------+
787- | tmp_graphXXX
788- +-----------------------+
789- | |
790- | |
791- | |
792- | graph-{hash0} |
793- | |
794- | |
795- | |
796- +-----------------------+</ pre >
775+ < pre > +---------------------+
776+ | |
777+ | (new commits) |
778+ | |
779+ +---------------------+
780+ | |
781+ +-----------------------+ +---------------------+
782+ | graph-{hash2} |->| |
783+ +-----------------------+ +---------------------+
784+ | | |
785+ +-----------------------+ +---------------------+
786+ | | | |
787+ | graph-{hash1} |->| |
788+ | | | |
789+ +-----------------------+ +---------------------+
790+ | tmp_graphXXX
791+ +-----------------------+
792+ | |
793+ | |
794+ | |
795+ | graph-{hash0} |
796+ | |
797+ | |
798+ | |
799+ +-----------------------+</ pre >
797800</ div >
798801</ div >
799802< div class ="paragraph ">
@@ -805,18 +808,16 @@ <h2 id="_merging_commit_graph_files">Merging commit-graph files</h2>
805808</ div >
806809< div class ="listingblock ">
807810< div class ="content ">
808- < pre class =" highlight " > < code > {hash3}
809- {hash0}</ code > </ pre >
811+ < pre > {hash3}
812+ {hash0}</ pre >
810813</ div >
811814</ div >
812815< div class ="paragraph ">
813816< p > We then close the lock-file.</ p >
814817</ div >
815818</ div >
816- </ div >
817- < div class ="sect1 ">
818- < h2 id ="_merge_strategy "> Merge Strategy</ h2 >
819- < div class ="sectionbody ">
819+ < div class ="sect2 ">
820+ < h3 id ="_merge_strategy "> Merge Strategy</ h3 >
820821< div class ="paragraph ">
821822< p > When writing a set of commits that do not exist in the commit-graph stack of
822823height N, we default to creating a new file at level N + 1. We then decide to
@@ -851,10 +852,8 @@ <h2 id="_merge_strategy">Merge Strategy</h2>
851852flexibility.</ p >
852853</ div >
853854</ div >
854- </ div >
855- < div class ="sect1 ">
856- < h2 id ="_handling_mixed_generation_number_chains "> Handling Mixed Generation Number Chains</ h2 >
857- < div class ="sectionbody ">
855+ < div class ="sect2 ">
856+ < h3 id ="_handling_mixed_generation_number_chains "> Handling Mixed Generation Number Chains</ h3 >
858857< div class ="paragraph ">
859858< p > With the introduction of generation number v2 and generation data chunk, the
860859following scenario is possible:</ p >
@@ -895,10 +894,8 @@ <h2 id="_handling_mixed_generation_number_chains">Handling Mixed Generation Numb
895894single layer with corrected commit dates.</ p >
896895</ div >
897896</ div >
898- </ div >
899- < div class ="sect1 ">
900- < h2 id ="_deleting_graph_hash_files "> Deleting graph-{hash} files</ h2 >
901- < div class ="sectionbody ">
897+ < div class ="sect2 ">
898+ < h3 id ="_deleting_graph_hash_files "> Deleting graph-{hash} files</ h3 >
902899< div class ="paragraph ">
903900< p > After a new tip file is written, some < code > graph-</ code > {hash} files may no longer
904901be part of a chain. It is important to remove these files from disk, eventually.
@@ -915,10 +912,8 @@ <h2 id="_deleting_graph_hash_files">Deleting graph-{hash} files</h2>
915912setting.</ p >
916913</ div >
917914</ div >
918- </ div >
919- < div class ="sect1 ">
920- < h2 id ="_chains_across_multiple_object_directories "> Chains across multiple object directories</ h2 >
921- < div class ="sectionbody ">
915+ < div class ="sect2 ">
916+ < h3 id ="_chains_across_multiple_object_directories "> Chains across multiple object directories</ h3 >
922917< div class ="paragraph ">
923918< p > In a repo with alternates, we look for the < code > commit-graph-chain</ code > file starting
924919in the local object directory and then in each alternate. The first file that
@@ -966,6 +961,7 @@ <h2 id="_chains_across_multiple_object_directories">Chains across multiple objec
966961</ div >
967962</ div >
968963</ div >
964+ </ div >
969965< div class ="sect1 ">
970966< h2 id ="_related_links "> Related Links</ h2 >
971967< div class ="sectionbody ">
@@ -1012,7 +1008,7 @@ <h2 id="_related_links">Related Links</h2>
10121008</ div >
10131009< div id ="footer ">
10141010< div id ="footer-text ">
1015- Last updated 2025-06-20 18:10:42 -0700
1011+ Last updated 2025-10-24 14:37:25 -0700
10161012</ div >
10171013</ div >
10181014</ body >
0 commit comments