logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Git::Repository::Plugin::Log - Add a log() method to Git::Repository

Acknowledgements

       Many thanks to Aristotle Pagaltzis who requested a "log()" method in the first place, and for very
       interesting conversations on the topic.

Description

       This module adds a new method to Git::Repository.

License

       This program is free software; you can redistribute it and/or modify it under the same terms as Perl
       itself.

perl v5.34.0                                       2022-06-14                  Git::Repository::Plugin::Log(3pm)

Method

log
          # iterator
          my $iter = $r->log( @args );

          # all Git::Repository::Log objects obtained from the log
          my @logs = $r->log( @args );

       Run "git log" with the given arguments.

       In scalar context, returns a Git::Repository::Log::Iterator object, which can return Git::Repository::Log
       objects on demand.

       In list context, returns the full list Git::Repository::Log objects.  Note that this can be very memory-
       intensive.

       See Git::Repository::Log::Iterator's documentation for details about how parameters are handled.

Name

       Git::Repository::Plugin::Log - Add a log() method to Git::Repository

See Also

       Git::Repository::Plugin, Git::Repository::Log::Iterator, Git::Repository::Log.

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() ) {
               ...;
           }

See Also