NAME

Git::Native::Revwalker - Walk commits in topological / time order

VERSION

version 0.003

SYNOPSIS

my $walker = $repo->revwalker;
$walker->push_head;
$walker->sorting( Git::Native::Revwalker::GIT_SORT_TIME );
while ( my $oid = $walker->next ) {
  say $oid->hex;
}

DESCRIPTION

Wraps libgit2's git_revwalk*. Push starting points (commits, refs, globs), optionally hide commits to exclude, then iterate with next.

push_oid($oid)

Mark a commit as a starting point. $oid may be a hex string or a Git::Native::Oid.

push_head / push_ref($refname) / push_glob($pattern) / push_range("A..B")

Convenience pushers.

hide_oid / hide_head / hide_ref / hide_glob

Exclude commits and their ancestors from the walk.

sorting($mode)

Bitfield of GIT_SORT_NONE, GIT_SORT_TOPOLOGICAL, GIT_SORT_TIME, GIT_SORT_REVERSE.

next

Returns the next Git::Native::Oid, or undef when exhausted.

all

Drains the walker into an arrayref of Git::Native::Oid.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-git-native/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.