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 | |
Git commit graph file reader/writer. |
| Class | |
Represents a chunk in the commit graph file. |
| Class | |
Represents a single commit entry in the commit graph. |
| Function | find |
Find commit graph file in a Git repository. |
| Function | generate |
Generate a commit graph from a set of commits. |
| Function | get |
Get all commits reachable from the given starting commits. |
| Function | read |
Read commit graph from file path. |
| Function | write |
Write a commit graph file for the given commits. |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | CHUNK |
Undocumented |
| Constant | COMMIT |
Undocumented |
| Constant | COMMIT |
Undocumented |
| Constant | GENERATION |
Undocumented |
| Constant | GENERATION |
Undocumented |
| Constant | GENERATION |
Undocumented |
| Constant | GRAPH |
Undocumented |
| Constant | GRAPH |
Undocumented |
| Constant | GRAPH |
Undocumented |
| Constant | GRAPH |
Undocumented |
| Constant | HASH |
Undocumented |
| Constant | HASH |
Undocumented |
def generate_commit_graph(object_store:
BaseObjectStore, commit_ids: Sequence[ ObjectID]) -> CommitGraph:
¶
Generate a commit graph from a set of commits.
| Parameters | |
objectBaseObjectStore | Object store to retrieve commits from |
commitSequence[ | List of commit IDs to include in the graph |
| Returns | |
CommitGraph | CommitGraph 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 | |
objectBaseObjectStore | Object store to retrieve commits from |
startSequence[ | List of starting commit IDs |
| Returns | |
list[ | List of all reachable commit IDs (including the starting commits) |
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 | |
gitstr | bytes | Git directory path |
objectBaseObjectStore | Object store to retrieve commits from |
commitSequence[ | List of commit IDs to include in the graph |