class documentation

Git commit graph file reader/writer.

Class Method from_file Read commit graph from file.
Method __init__ Initialize CommitGraph.
Method __iter__ Iterate over commit graph entries.
Method __len__ Return number of commits in the graph.
Method get_entry_by_oid Get commit graph entry by commit OID.
Method get_generation_number Get generation number for a commit.
Method get_parents Get parent commit IDs for a commit.
Method write_to_file Write commit graph to file.
Instance Variable chunks Undocumented
Instance Variable entries Undocumented
Instance Variable hash_version Undocumented
Instance Variable object_format Undocumented
Class Method _read_from_file Read commit graph data from file.
Method _parse_chunks Parse chunk data into entries.
Method _parse_extra_edges Parse extra parent edges for commits with 3+ parents.
Instance Variable _oid_to_index Undocumented
def from_file(cls, f: BinaryIO) -> CommitGraph:

Read commit graph from file.

def __init__(self, *, object_format: ObjectFormat | None = None):

Initialize CommitGraph.

Parameters
object_format:ObjectFormat | NoneObject format to use (defaults to SHA1)
def __iter__(self) -> Iterator[CommitGraphEntry]:

Iterate over commit graph entries.

def __len__(self) -> int:

Return number of commits in the graph.

def get_entry_by_oid(self, oid: ObjectID) -> CommitGraphEntry | None:

Get commit graph entry by commit OID.

def get_generation_number(self, oid: ObjectID) -> int | None:

Get generation number for a commit.

def get_parents(self, oid: ObjectID) -> list[ObjectID] | None:

Get parent commit IDs for a commit.

def write_to_file(self, f: BinaryIO | _GitFile):

Write commit graph to file.

Undocumented

Undocumented

hash_version =

Undocumented

object_format =

Undocumented

def _read_from_file(cls, f: BinaryIO) -> CommitGraph:

Read commit graph data from file.

def _parse_chunks(self):

Parse chunk data into entries.

def _parse_extra_edges(self, offset: int, oids: Sequence[RawObjectID]) -> list[RawObjectID]:

Parse extra parent edges for commits with 3+ parents.

_oid_to_index: dict[RawObjectID, int] =

Undocumented