line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Repository::Plugin::Log; |
2
|
|
|
|
|
|
|
$Git::Repository::Plugin::Log::VERSION = '1.312'; |
3
|
2
|
|
|
2
|
|
1543386
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
83
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
71
|
|
5
|
2
|
|
|
2
|
|
59
|
use 5.006; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
62
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1698
|
use Git::Repository::Plugin; |
|
2
|
|
|
|
|
1041
|
|
|
2
|
|
|
|
|
115
|
|
8
|
|
|
|
|
|
|
our @ISA = qw( Git::Repository::Plugin ); |
9
|
2
|
|
|
2
|
|
64
|
sub _keywords { qw( log ) } |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
1316
|
use Git::Repository::Log::Iterator; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
219
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub log { |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# skip the invocant when invoked as a class method |
16
|
13
|
100
|
|
13
|
1
|
34553921
|
shift if !ref $_[0]; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# get the iterator |
19
|
13
|
|
|
|
|
237
|
my $iter = Git::Repository::Log::Iterator->new(@_); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# scalar context: return the iterator |
22
|
11
|
100
|
|
|
|
502
|
return $iter if !wantarray; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# list context: return all Git::Repository::Log objects |
25
|
9
|
|
|
|
|
30
|
my @logs; |
26
|
9
|
|
|
|
|
94
|
while ( my $log = $iter->next ) { |
27
|
13
|
|
|
|
|
90
|
push @logs, $log; |
28
|
|
|
|
|
|
|
} |
29
|
7
|
|
|
|
|
229
|
return @logs; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# ABSTRACT: Add a log() method to Git::Repository |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Git::Repository::Plugin::Log - Add a log() method to Git::Repository |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 1.312 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# load the plugin |
51
|
|
|
|
|
|
|
use Git::Repository 'Log'; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $r = Git::Repository->new(); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# get all log objects |
56
|
|
|
|
|
|
|
my @logs = $r->log(qw( --since=yesterday )); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# get an iterator |
59
|
|
|
|
|
|
|
my $iter = $r->log(qw( --since=yesterday )); |
60
|
|
|
|
|
|
|
while ( my $log = $iter->next() ) { |
61
|
|
|
|
|
|
|
...; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This module adds a new method to L<Git::Repository>. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 METHOD |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 log |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# iterator |
73
|
|
|
|
|
|
|
my $iter = $r->log( @args ); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# all Git::Repository::Log objects obtained from the log |
76
|
|
|
|
|
|
|
my @logs = $r->log( @args ); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Run C<git log> with the given arguments. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
In scalar context, returns a L<Git::Repository::Log::Iterator> object, |
81
|
|
|
|
|
|
|
which can return L<Git::Repository::Log> objects on demand. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
In list context, returns the full list L<Git::Repository::Log> objects. |
84
|
|
|
|
|
|
|
Note that this can be very memory-intensive. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
See L<Git::Repository::Log::Iterator>'s documentation for details about |
87
|
|
|
|
|
|
|
how parameters are handled. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Many thanks to Aristotle Pagaltzis who requested a C<log()> method in |
92
|
|
|
|
|
|
|
the first place, and for very interesting conversations on the topic. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 SEE ALSO |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L<Git::Repository::Plugin>, |
97
|
|
|
|
|
|
|
L<Git::Repository::Log::Iterator>, |
98
|
|
|
|
|
|
|
L<Git::Repository::Log>. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 BUGS |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
103
|
|
|
|
|
|
|
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Git-Repository-Plugin-Log or by |
104
|
|
|
|
|
|
|
email to bug-git-repository-plugin-log@rt.cpan.org. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
107
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
108
|
|
|
|
|
|
|
feature. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Philippe Bruhat (BooK) <book@cpan.org> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 COPYRIGHT |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Copyright 2010-2013 Philippe Bruhat (BooK), all rights reserved. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 LICENSE |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
121
|
|
|
|
|
|
|
under the same terms as Perl itself. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|