Git::FastExport - A parser for git fast-export streams
version 0.108
use Git::Repository; use Git::FastExport; # get the fast-export stream from a Git::Repository my $r = Git::Repository->new(); my $fh = $r->command(qw( fast-export --progress=1 --date-order --all ))->stdout; # create the parser object my $export = Git::FastExport->new($fh); # extract blocks from the fast-import stream while ( my $block = $export->next_block() ) { # do something with $block }
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.
This class provides the following methods:
my $export = Git::FastExport->new($fh);
The constructor takes an open filehandle and returns a Git::FastExport object attached to it.
Git::FastExport
my $block = $export->next_block();
Returns 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 filehandle of the Git::FastExport object.
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.
Philippe Bruhat (BooK) <book@cpan.org>
Copyright 2008-2016 Philippe Bruhat (BooK), All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Git::FastExport, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::FastExport
CPAN shell
perl -MCPAN -e shell install Git::FastExport
For more information on module installation, please visit the detailed CPAN module installation guide.