DOKK / manpages / debian 12 / libgit-raw-perl / Git::Raw::Walker.3pm.en
Git::Raw::Walker(3pm) User Contributed Perl Documentation Git::Raw::Walker(3pm)

Git::Raw::Walker - Git revwalker class

version 0.90

    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;
    }

A Git::Raw::Walker represents a graph walker used to walk through the repository's revisions (sort of like "git log").

WARNING: The API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog).

Create a new revision walker.

Change the sorting mode when iterating through the repository's contents. Values for @order may be one or more of the following:

  • "none"

    Sort the repository contents in no particular ordering, that is, sorting is arbitrary, implementation-specific and subject to change at any time. (Default)

  • "topological"

    Sort the repository contents in topological order (parents before children). This sorting mode may be combined with time sorting.

  • "time"

    Sort the repository contents by commit time. This sorting mode may be combined with topological sorting.

  • "reverse"

    Iterate through the repository contents in reverse order. This sorting mode may be combined with any of the above.

Push a Git::Raw::Commit to the list of commits to be used as roots when starting a revision walk.

Push references by $glob to the list of commits to be used as roots when starting a revision walk.

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

Push HEAD of the repository to the list of commits to be used as roots when starting a revision walk.

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

Push and hide the respective endpoints of the given range. $range should be of the form "start_commit_id..end_commit_id".

Hide a Git::Raw::Commit and its ancestors from the walker.

Hide references by $glob and all ancestors from the walker.

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

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

Retrieve the next commit from the revision walk. Returns a Git::Raw::Commit object or "undef" if there are no commits.

Retrieve all commits. Returns a list of Git::Raw::Commit objects.

Reset the revision walker (this is done automatically at the end of a walk).

Alessandro Ghedini <alexbio@cpan.org>

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.

2022-10-29 perl v5.36.0