RevWalk class

A revision walker for traversing the commit history of a repository.

The revision walker provides a way to traverse the commit history of a repository in various orders and with different filtering options. It's useful for operations like viewing commit history, finding merge bases, or analyzing repository structure.

Example usage:

final repo = Repository.open('path/to/repo');
final walker = RevWalk(repo);

// Configure walker
walker.sorting({GitSort.time, GitSort.reverse});
walker.pushHead();

// Get commits
final commits = walker.walk(limit: 10);

Constructors

RevWalk(Repository repo)
Initializes a new instance of the RevWalk class.

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

free() → void
Releases memory allocated for RevWalk object.
hide(Oid oid) → void
Marks a commit oid (and its ancestors) uninteresting for the output.
hideGlob(String glob) → void
Hides matching references.
hideHead() → void
Hides the repository's HEAD and its ancestors.
hideReference(String reference) → void
Hides the oid pointed to by a reference.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
push(Oid oid) → void
Adds a new root commit oid for the traversal.
pushGlob(String glob) → void
Adds matching references for the traversal.
pushHead() → void
Adds the repository's HEAD for the traversal.
pushRange(String range) → void
Adds and hide the respective endpoints of the given range for the traversal.
pushReference(String reference) → void
Adds the oid pointed to by a reference for the traversal.
reset() → void
Resets the revision walker for reuse.
simplifyFirstParent() → void
Simplify the history by first-parent.
sorting(Set<GitSort> sorting) → void
Changes the sorting mode when iterating through the repository's contents to provided sorting combination of GitSort modes.
toString() String
A string representation of this object.
inherited
walk({int limit = 0}) List<Commit>
Returns the list of commits from the revision walk.

Operators

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