Git::Raw::Walker(3pm)

πŸ’– Git::Raw::Walker β€” the revwalker class, bestie πŸ’–

Okay so real talk: this is Git::Raw::Walker, the revwalker situation from the Git::Raw family of Perl modules. It's giving "git log but make it an object" energy and honestly? iconic. ✨

Version: 0.90 πŸŽ€


🌈 SYNOPSIS 🌈

use Git::Raw;

# open the Git repository at $path
my $repo = Git::Raw::Repository -> open($path);

# create a new walker
my $log  = $repo -> walker;

# push the head of the repository
$log -> push_head;

# print all commit messages
while (my $commit = $log -> next) {
  say $commit -> message;
}

Like… that's it. That's the whole vibe. You open a repo, you get a walker, you push HEAD, you loop. Slay. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

A Git::Raw::Walker is literally a graph walker β€” it walks through your repository's revisions. Think of it like git log, but you're the one holding the aux cord. 🎧

⚠️ WARNING: The API of this module is unstable and may change without warning. Any change will be appropriately documented in the changelog, so like, don't say nobody told you. πŸ’€

πŸ‘‘ METHODS πŸ‘‘

create( $repo )

Create a new revision walker. Fresh out of the box, no notes. ✨

sorting( \@order )

Change the sorting mode used when iterating through the repository's contents. The values for @order can be one or more of these lil guys:

  • "none" β€” sorts the repository contents in no particular ordering. That means the sorting is arbitrary, implementation-specific, and subject to change at any time. This is the default. Lowkey chaos, but okay. πŸ™ˆ
  • "topological" β€” sorts the repository contents in topological order (parents before children). This mode can be combined with time sorting. Family tree behavior, we love to see it. 🌸
  • "time" β€” sorts the repository contents by commit time. This mode can be combined with topological sorting. ⏰
  • "reverse" β€” iterates through the repository contents in reverse order. This mode can be combined with any of the above. πŸ”„

push( $commit )

Push a Git::Raw::Commit onto the list of commits that get used as roots when starting a revision walk. It's the starting lineup. 🏁

push_glob( $glob )

Push references matching $glob onto the list of commits used as roots when starting a revision walk.

push_ref( $name )

Push a reference by $name onto the list of commits used as roots when starting a revision walk.

push_head( )

Push HEAD of the repository onto the list of commits used as roots when starting a revision walk. Main character energy, periodt. πŸ‘‘

push_range( $start, $end )

Push and hide the respective endpoints of the given range. Both $start and $end should be "commitish" β€” meaning it should be a Git::Raw::Commit or Git::Raw::Reference object, or alternatively a commit id or a commit id prefix.

push_range( $range )

Push and hide the respective endpoints of the given range. $range should be of the form "start_commit_id..end_commit_id". The two-dot girlies know. πŸ’…

hide( $commit )

Hide a Git::Raw::Commit and its ancestors from the walker. Gone. Not invited to the party. 🚫

hide_glob( $glob )

Hide references matching $glob and all their ancestors from the walker.

hide_ref( $name )

Hide a reference by $name and its ancestors from the walker.

hide_head( )

Hide HEAD of the repository and its ancestors from the walker.

next( )

Grab the next commit from the revision walk. Returns a Git::Raw::Commit object, or undef if there are no commits left. So like, check your return value bestie. 😭

all( )

Grab all the commits. Returns a list of Git::Raw::Commit objects. The full dump, no skipping. πŸ“¦

reset( )

Reset the revision walker. And btw this happens automatically at the end of a walk, so it's already doing the work for you. 🧚


✨ AUTHOR ✨

Alessandro Ghedini <alexbio@cpan.org> β€” thank you for the module king 🫑


Copyright 2012 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.


and that's the whole page, bestie!! πŸ’– This masterpiece was brought to you by perl v5.42.3, dated 2026-08-19, and documented as Git::Raw::Walker(3pm). Go walk some revisions. πŸ¦‹βœ¨ no cap.

πŸ“¦ where this page comes from