pub struct Commit {
pub id: String,
pub branch: String,
pub tag: Option<String>,
pub kind: CommitKind,
pub parent: Option<usize>,
pub merge_parent: Option<usize>,
}Expand description
A single commit on a branch in the git graph.
id is the display identifier (auto-generated as c0, c1, … when the
source omits id: "..."). branch is the name of the branch this commit
lives on. tag is an optional label rendered next to the commit in [...].
parent is the index into GitGraph::commits of the preceding commit on
the same branch (or None for the initial commit of main). merge_parent
is only set for Merge commits and points to the HEAD of the branch being
merged in.
Fields§
§id: StringShort display id (e.g. "c0", "second", "feature-x").
branch: StringName of the branch this commit belongs to.
tag: Option<String>Optional release / annotation tag rendered as [tag].
kind: CommitKindClassification of this commit.
parent: Option<usize>Index into GitGraph::commits of the direct parent (same-branch
predecessor). None only for the very first commit of main.
merge_parent: Option<usize>Index into GitGraph::commits of the merge-source HEAD.
Only set when kind == CommitKind::Merge.