libgit2

git_revwalk_next

Version:

Get the next commit from the revision walk.

The initial call to this method is not blocking when iterating through a repo with a time-sorting mode.

Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo).

The revision walker is reset when the walk is over.

Signature

int git_revwalk_next(git_oid *out, git_revwalk *walk);

Parameters

In
out

Pointer where to store the oid of the next commit

In
walk

the walker to pop the commit from.

Returns

int

0 if the next commit was found; GIT_ITEROVER if there are no commits left to iterate

Versions