Git::Database - Provide access to the Git object database
version 0.010
# get a store my $r = Git::Repository->new(); # build a backend to access the store my $db = Git::Database::Backend::Git::Repository->new( store => $r ); # or let Git::Database figure it out by itself my $db = Git::Database->new( store => $r ); # or let Git::Database assemble the store from its parts my $db = Git::Database->new( backend => 'Git::Repository', work_tree => $work_tree, ); my $db = Git::Database->new( backend => 'Git::Repository', git_dir => $git_dir, ); # work in the current directory my $db = Git::Database->new( backend => 'Git::Repository' ); # pick the best available backend my $db = Git::Database->new;
Git::Database provides access from Perl to the object database stored in a Git repository. It can use any supported Git wrapper to access the Git object database maintained by Git.
Git::Database is actually a factory class: "new" returns backend instances.
Check Git::Database::Tutorial for details.
my $r = Git::Repository->new; # $db is-a Git::Database::Backend::Git::Repository my $db = Git::Database->new( store => $r );
Return a backend object, based on the parameters passed to new().
new()
If the store parameter is given, all other paramaters are ignored, and the returned backend is of the class corresponding to the store object.
store
If the store parameter is missing, the backend class is selected according to the backend parameter, or picked automatically among the available store classes (picking the fastest and more feature-complete among them). The actual store object is then instantiated using the work_tree and git_dir optional parameters. If none is given, the repository is assumed to be in the current directory.
backend
work_tree
git_dir
say for Git::Database->available_stores;
This class methods returns the list of store classes that are available (i.e. installed with a version matching the minimum version requirements).
The backend methods are split between several roles, and not all backends do all the roles. Therefore not all backend objects support all the following methods.
This is the minimum required role to be a backend. Hence this method is always available.
Git::Database::Object::Blob, Git::Database::Object::Tree, Git::Database::Object::Commit, Git::Database::Object::Tag.
Git::Database::Role::Backend, Git::Database::Role::ObjectReader, Git::Database::Role::ObjectWriter, Git::Database::Role::RefReader, Git::Database::Role::RefWriter.
Git::Database::Backend::None, Git::Database::Backend::Git::Repository, Git::Database::Backend::Git::Sub, Git::Database::Backend::Git::PurePerl, Git::Database::Backend::Cogit, Git::Database::Backend::Git, Git::Database::Backend::Git::Wrapper, Git::Database::Backend::Git::Raw.
You can find documentation for this module with the perldoc command.
perldoc Git::Database
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Git-Database
CPAN Ratings
http://cpanratings.perl.org/d/Git-Database
Search CPAN
http://search.cpan.org/dist/Git-Database
MetaCPAN
http://metacpan.org/release/Git-Database
Philippe Bruhat (BooK) <book@cpan.org>.
Copyright 2013-2017 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::Database, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Database
CPAN shell
perl -MCPAN -e shell install Git::Database
For more information on module installation, please visit the detailed CPAN module installation guide.