NAME

Git::FastExport - A module to parse the output of git-fast-export

VERSION

version 0.102

SYNOPSIS

use Git::Repository;
use Git::FastExport;

# get the object from a Git::Repository
my $repo = Git::Repository->new( work_tree => $path );
my $export = Git::FastExport->new($repo);

# or simply from a path specification
my $export = Git::FastExport->new($path);

while ( my $block = $export->next_block() ) {

    # do something with $block

}

DESCRIPTION

Git::FastExport is a module that parses the output of git-fast-export and returns Git::FastExport::Block objects that can be inspected or modified before being eventually passed on as the input to git-fast-import.

METHODS

This class provides the following methods:

new( [ $repository ] )

The constructor takes an optional Git::Repository object, or a path (to a GIT_DIR or GIT_WORK_TREE), and returns a Git::FastExport object attached to it.

fast_export( @args )

Initialize a git-fast-export command on the repository, using the arguments given in @args.

next_block()

Return the next block in the git-fast-export stream as a Git::FastExport::Block object.

Return nothing at the end of stream.

This methods reads from the export_fh filehandle of the Git::FastExport object. It is normally setup via the fast_export() method, but it is possible to make it read directly from STDIN (or another filehandle) by doing:

$export->{export_fh} = \*STDIN;
while ( my $block = $export->next_block() ) {
    ...
}

BUGS

Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=Git-FastExport or by email to bug-git-fastexport@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>

ACKNOWLEDGEMENTS

The original version of this module was created as part of my work for BOOKING.COM, which authorized its publication/distribution under the same terms as Perl itself.

COPYRIGHT

Copyright 2008-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.