module documentation

Git commit graph file format support.

Git's commit graph files store commit metadata and generation numbers for faster graph traversal operations like merge-base computation.

The commit graph format is documented at: https://git-scm.com/docs/gitformat-commit-graph

Class CommitGraph Git commit graph file reader/writer.
Class CommitGraphChunk Represents a chunk in the commit graph file.
Class CommitGraphEntry Represents a single commit entry in the commit graph.
Function find_commit_graph_file Find commit graph file in a Git repository.
Function generate_commit_graph Generate a commit graph from a set of commits.
Function get_reachable_commits Get all commits reachable from the given starting commits.
Function read_commit_graph Read commit graph from file path.
Function write_commit_graph Write a commit graph file for the given commits.
Constant CHUNK_BASE_GRAPHS_LIST Undocumented
Constant CHUNK_BLOOM_FILTER_DATA Undocumented
Constant CHUNK_BLOOM_FILTER_INDEX Undocumented
Constant CHUNK_COMMIT_DATA Undocumented
Constant CHUNK_EXTRA_EDGE_LIST Undocumented
Constant CHUNK_GENERATION_DATA Undocumented
Constant CHUNK_GENERATION_DATA_OVERFLOW Undocumented
Constant CHUNK_OID_FANOUT Undocumented
Constant CHUNK_OID_LOOKUP Undocumented
Constant COMMIT_GRAPH_SIGNATURE Undocumented
Constant COMMIT_GRAPH_VERSION Undocumented
Constant GENERATION_NUMBER_INFINITY Undocumented
Constant GENERATION_NUMBER_V1_MAX Undocumented
Constant GENERATION_NUMBER_ZERO Undocumented
Constant GRAPH_EXTRA_EDGES_NEEDED Undocumented
Constant GRAPH_LAST_EDGE Undocumented
Constant GRAPH_PARENT_MISSING Undocumented
Constant GRAPH_PARENT_NONE Undocumented
Constant HASH_VERSION_SHA1 Undocumented
Constant HASH_VERSION_SHA256 Undocumented
def find_commit_graph_file(git_dir: str | bytes) -> bytes | None:

Find commit graph file in a Git repository.

def generate_commit_graph(object_store: BaseObjectStore, commit_ids: Sequence[ObjectID]) -> CommitGraph:

Generate a commit graph from a set of commits.

Parameters
object_store:BaseObjectStoreObject store to retrieve commits from
commit_ids:Sequence[ObjectID]List of commit IDs to include in the graph
Returns
CommitGraphCommitGraph object containing the specified commits
def get_reachable_commits(object_store: BaseObjectStore, start_commits: Sequence[ObjectID]) -> list[ObjectID]:

Get all commits reachable from the given starting commits.

Parameters
object_store:BaseObjectStoreObject store to retrieve commits from
start_commits:Sequence[ObjectID]List of starting commit IDs
Returns
list[ObjectID]List of all reachable commit IDs (including the starting commits)
def read_commit_graph(path: str | bytes) -> CommitGraph | None:

Read commit graph from file path.

def write_commit_graph(git_dir: str | bytes, object_store: BaseObjectStore, commit_ids: Sequence[ObjectID]):

Write a commit graph file for the given commits.

Parameters
git_dir:str | bytesGit directory path
object_store:BaseObjectStoreObject store to retrieve commits from
commit_ids:Sequence[ObjectID]List of commit IDs to include in the graph
CHUNK_BASE_GRAPHS_LIST: bytes =

Undocumented

Value
b'BASE'
CHUNK_BLOOM_FILTER_DATA: bytes =

Undocumented

Value
b'BDAT'
CHUNK_BLOOM_FILTER_INDEX: bytes =

Undocumented

Value
b'BIDX'
CHUNK_COMMIT_DATA: bytes =

Undocumented

Value
b'CDAT'
CHUNK_EXTRA_EDGE_LIST: bytes =

Undocumented

Value
b'EDGE'
CHUNK_GENERATION_DATA: bytes =

Undocumented

Value
b'GDA2'
CHUNK_GENERATION_DATA_OVERFLOW: bytes =

Undocumented

Value
b'GDO2'
CHUNK_OID_FANOUT: bytes =

Undocumented

Value
b'OIDF'
CHUNK_OID_LOOKUP: bytes =

Undocumented

Value
b'OIDL'
COMMIT_GRAPH_SIGNATURE: bytes =

Undocumented

Value
b'CGPH'
COMMIT_GRAPH_VERSION: int =

Undocumented

Value
1
GENERATION_NUMBER_INFINITY: int =

Undocumented

Value
4294967295
GENERATION_NUMBER_V1_MAX: int =

Undocumented

Value
1073741823
GENERATION_NUMBER_ZERO: int =

Undocumented

Value
0
GRAPH_EXTRA_EDGES_NEEDED: int =

Undocumented

Value
2147483648
GRAPH_LAST_EDGE: int =

Undocumented

Value
2147483648
GRAPH_PARENT_MISSING: int =

Undocumented

Value
1879048192
GRAPH_PARENT_NONE: int =

Undocumented

Value
1879048192
HASH_VERSION_SHA1: int =

Undocumented

Value
1
HASH_VERSION_SHA256: int =

Undocumented

Value
2