Git::Repository::Plugin::Log(3pm)

Git::Repository::Plugin::Log3pm

Add a log() method to git::repository

Usage

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

Overview

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

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.

Acknowledgements

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

Releases

7 releases since Debian 7 (Wheezy); the text changed 3 times.

  1. 7
  2. 8
  3. 9–11
  4. 12–13

License

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

From libgit-repository-plugin-log-perl 1.314-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.