/usr/share/perl5/Git/Repository/Plugin/Log.pm is in libgit-repository-plugin-log-perl 1.313-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | package Git::Repository::Plugin::Log;
$Git::Repository::Plugin::Log::VERSION = '1.313';
use warnings;
use strict;
use 5.006;
use Git::Repository::Plugin;
our @ISA = qw( Git::Repository::Plugin );
sub _keywords { qw( log ) }
use Git::Repository::Log::Iterator;
sub log {
# skip the invocant when invoked as a class method
shift if !ref $_[0];
# get the iterator
my $iter = Git::Repository::Log::Iterator->new(@_);
# scalar context: return the iterator
return $iter if !wantarray;
# list context: return all Git::Repository::Log objects
my @logs;
while ( my $log = $iter->next ) {
push @logs, $log;
}
return @logs;
}
1;
__END__
=pod
=head1 NAME
Git::Repository::Plugin::Log - Add a log() method to Git::Repository
=head1 SYNOPSIS
# load the plugin
use Git::Repository 'Log';
my $r = Git::Repository->new();
# get all log objects
my @logs = $r->log(qw( --since=yesterday ));
# get an iterator
my $iter = $r->log(qw( --since=yesterday ));
while ( my $log = $iter->next() ) {
...;
}
=head1 DESCRIPTION
This module adds a new method to L<Git::Repository>.
=head1 METHOD
=head2 log
# iterator
my $iter = $r->log( @args );
# all Git::Repository::Log objects obtained from the log
my @logs = $r->log( @args );
Run C<git log> with the given arguments.
In scalar context, returns a L<Git::Repository::Log::Iterator> object,
which can return L<Git::Repository::Log> objects on demand.
In list context, returns the full list L<Git::Repository::Log> objects.
Note that this can be very memory-intensive.
See L<Git::Repository::Log::Iterator>'s documentation for details about
how parameters are handled.
=head1 ACKNOWLEDGEMENTS
Many thanks to Aristotle Pagaltzis who requested a C<log()> method in
the first place, and for very interesting conversations on the topic.
=head1 SEE ALSO
L<Git::Repository::Plugin>,
L<Git::Repository::Log::Iterator>,
L<Git::Repository::Log>.
=head1 COPYRIGHT
Copyright 2010-2016 Philippe Bruhat (BooK), all rights reserved.
=head1 LICENSE
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
|