GitHistory class abstract interface Getting started

History of one repository: ancestry, merge bases and path history.

The revision expressions of its parameters follow the grammar documented on GitRevisionResolver: an expression that reads like an option — it starts with - — names no revision, and the operations refuse with GitUnknownRevisionException before any command runs. Paths are literal and always travel after git's -- marker, so a path can never be read as an option either.

final GitOid? forkPoint = await repo.history.mergeBase(head, base);
final bool contained = await repo.history.isAncestor(base, head);
final List<GitOid> touching =
    await repo.history.commitsTouching('README.md');
final List<GitLogEntry> carried =
    await repo.history.commitsSince(base.value, 'refs/heads/topic');
final List<GitLogCommit> recent = await repo.history.log(limit: 20);
Implemented types

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

commitsSince(String base, String tip) → Future<List<GitLogEntry>>
Commits reachable from tip but not from base, newest first, each named with its subject.
commitsTouching(String path, {String? from, String? to}) → Future<List<GitOid>>
Commits reachable from to but not from from that touched path, newest first.
isAncestor(GitOid ancestor, GitOid descendant) → Future<bool>
Whether ancestor is an ancestor of descendant; see GitHistoryReader.isAncestor.
override
lastCommitTouching(String path, {String? rev}) → Future<GitOid?>
Most recent commit that touched path, or null when none did.
log({String to = 'HEAD', String? from, String? path, int? limit, bool firstParent = false}) → Future<List<GitLogCommit>>
Complete commits reachable from to but not from from.
mergeBase(GitOid first, GitOid second) → Future<GitOid?>
Best common ancestor of first and second; see GitHistoryReader.mergeBase.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited