Philippe Bruhat (BooK)

NAME

Git::Repository::Log::Iterator - Split a git log stream into records

VERSION

version 1.311

SYNOPSIS

    use Git::Repository::Log::Iterator;

    # use a default Git::Repository context
    my $iter = Git::Repository::Log::Iterator->new('HEAD~10..');

    # or provide an existing instance
    my $iter = Git::Repository::Log::Iterator->new( $r, 'HEAD~10..' );

    # get the next log record
    while ( my $log = $iter->next ) {
        ...;
    }

DESCRIPTION

Git::Repository::Log::Iterator initiates a git log command from a list of paramaters and parses its output to produce Git::Repository::Log objects represening each log item.

METHODS

new

    my $iter = Git::Repository::Log::Iterator->new( @args );

Create a new git log stream from the parameter list in @args and return a iterator on it.

new() will happily accept any parameters, but note that Git::Repository::Log::Iterator expects the output to look like that of --pretty=raw, and so will force the the --pretty option (in case format.pretty is defined in the Git configuration). It will also forcibly remove colored output (using --color=never).

Extra output (like patches) will be stored in the extra parameter of the Git::Repository::Log object. Decorations will be lost.

When unsupported options are recognized in the parameter list, new() will croak() with a message advising to use run( 'log' => ... ) to parse the output yourself.

next

    my $log = $iter->next;

Return the next log item as a Git::Repository::Log object, or nothing if the stream has ended.

BUGS

Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=Git-Repository-Plugin-Log or by email to bug-git-repository-plugin-log@rt.cpan.org.

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Philippe Bruhat (BooK) <book@cpan.org>

COPYRIGHT

Copyright 2010-2013 Philippe Bruhat (BooK), all rights reserved.

LICENSE

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




Hosting generously
sponsored by Bytemark