GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GIT::REPOSITORY::LOG::ITERATOR (3)

.ds Aq ’

NAME

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

CONTENTS

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 <B>git logB> 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 <B>git logB> 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.

The object is really a blessed hash reference, with only two keys:
cmd The Git::Repository::Command object running the actual <B>git logB> command. It might not be defined in some cases (see below new_from_fh and new_from_file).
fh The filehandle from which the output of <B>git logB> is actually read. This is the only attribute needed to run the next method.

    new_from_fh

This constructor makes it possible to provide the filehandle directly.

The cmd key is not defined when using this constructor.

    new_from_file

This constructor makes it possible to provide a filename that will be open()ed to produce a filehandle to read the log stream from.

The cmd key is not defined when using this constructor.

    next



    my $log = $iter->next;



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

COPYRIGHT

Copyright 2010-2016 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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GIT::REPOSITORY::LOG::ITERATOR (3) 2016-01-25

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.