blib/lib/Git/Raw/Walker.pm

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 14 / 14 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Git/Raw/Tree/Entry.pm ↑ Summary blib/lib/Git/Raw/Worktree.pm »
1 package Git::Raw::Walker;
2 1 $Git::Raw::Walker::VERSION = '0.90';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Git::Raw;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Git::Raw::Walker - Git revwalker class
11  
12 =head1 VERSION
13  
14 version 0.90
15  
16 =head1 SYNOPSIS
17  
18 use Git::Raw;
19  
20 # open the Git repository at $path
21 my $repo = Git::Raw::Repository -> open($path);
22  
23 # create a new walker
24 my $log = $repo -> walker;
25  
26 # push the head of the repository
27 $log -> push_head;
28  
29 # print all commit messages
30 while (my $commit = $log -> next) {
31 say $commit -> message;
32 }
33  
34 =head1 DESCRIPTION
35  
36 A L<Git::Raw::Walker> represents a graph walker used to walk through the
37 repository's revisions (sort of like C<git log>).
38  
39 B<WARNING>: The API of this module is unstable and may change without warning
40 (any change will be appropriately documented in the changelog).
41  
42 =head1 METHODS
43  
44 =head2 create( $repo )
45  
46 Create a new revision walker.
47  
48 =head2 sorting( \@order )
49  
50 Change the sorting mode when iterating through the repository's contents.
51 Values for C<@order> may be one or more of the following:
52  
53 =over 4
54  
55 =item * "none"
56  
57 Sort the repository contents in no particular ordering, that is, sorting is
58 arbitrary, implementation-specific and subject to change at any time. (Default)
59  
60 =item * "topological"
61  
62 Sort the repository contents in topological order (parents before children).
63 This sorting mode may be combined with time sorting.
64  
65 =item * "time"
66  
67 Sort the repository contents by commit time. This sorting mode may be combined
68 with topological sorting.
69  
70 =item * "reverse"
71  
72 Iterate through the repository contents in reverse order. This sorting mode may
73 be combined with any of the above.
74  
75 =back
76  
77 =head2 push( $commit )
78  
79 Push a L<Git::Raw::Commit> to the list of commits to be used as roots when
80 starting a revision walk.
81  
82 =head2 push_glob( $glob )
83  
84 Push references by C<$glob> to the list of commits to be used as roots when
85 starting a revision walk.
86  
87 =head2 push_ref( $name )
88  
89 Push a reference by C<$name> to the list of commits to be used as roots when
90 starting a revision walk.
91  
92 =head2 push_head( )
93  
94 Push HEAD of the repository to the list of commits to be used as roots when
95 starting a revision walk.
96  
97 =head2 push_range( $start, $end )
98  
99 Push and hide the respective endpoints of the given range. C<$start> and C<$end>
100 should be C<"commitish">, that is, it should be a L<Git::Raw::Commit> or
101 L<Git::Raw::Reference> object, or alternatively a commit id or commit id prefix.
102  
103 =head2 push_range( $range )
104  
105 Push and hide the respective endpoints of the given range. C<$range> should be
106 of the form C<"start_commit_id..end_commit_id">.
107  
108 =head2 hide( $commit )
109  
110 Hide a L<Git::Raw::Commit> and its ancestors from the walker.
111  
112 =head2 hide_glob( $glob )
113  
114 Hide references by C<$glob> and all ancestors from the walker.
115  
116 =head2 hide_ref( $name )
117  
118 Hide a reference by C<$name> and its ancestors from the walker.
119  
120 =head2 hide_head( )
121  
122 Hide HEAD of the repository and its ancestors from the walker.
123  
124 =head2 next( )
125  
126 Retrieve the next commit from the revision walk. Returns a L<Git::Raw::Commit>
127 object or C<undef> if there are no commits.
128  
129 =head2 all( )
130  
131 Retrieve all commits. Returns a list of L<Git::Raw::Commit> objects.
132  
133 =head2 reset( )
134  
135 Reset the revision walker (this is done automatically at the end of a walk).
136  
137 =head1 AUTHOR
138  
139 Alessandro Ghedini <alexbio@cpan.org>
140  
141 =head1 LICENSE AND COPYRIGHT
142  
143 Copyright 2012 Alessandro Ghedini.
144  
145 This program is free software; you can redistribute it and/or modify it
146 under the terms of either: the GNU General Public License as published
147 by the Free Software Foundation; or the Artistic License.
148  
149 See http://dev.perl.org/licenses/ for more information.
150  
151 =cut
152  
153 1 1; # End of Git::Raw::Walker
« blib/lib/Git/Raw/Tree/Entry.pm ↑ Summary blib/lib/Git/Raw/Worktree.pm »