NAME

Git::Gitalist::Repository - Model of a git repository

SYNOPSIS

my $gitrepo = dir('/repo/base/Gitalist');
my $repository = Git::Gitalist::Repository->new($gitrepo);
$repository->name;        # 'Gitalist'
$repository->path;        # '/repo/base/Gitalist/.git'
$repository->description; # 'Unnamed repository.'

DESCRIPTION

This class models a git repository, referred to in Gitalist as a "Repository".

ATTRIBUTES

name

The name of the Repository. If unspecified, this will be derived from the path to the git repository.

path

Path::Class:Dir for the filesystem path to the git repository.

description

The contents of .git/description.

owner

Owner of the files on the filesystem.

last_change

The DateTime of the last modification of the repository. This will be undef if the repository has never been used.

is_bare

True if this is a bare git repository.

heads

tags

An array of the name and sha1 of all heads/tags in the repository.

references

Hashref of ArrayRefs for each reference.

METHODS

head_hash ($head?)

Return the sha1 for HEAD, or any specified head.

get_object ($sha1)

Return an appropriate subclass of Git::Gitalist::Object for the given sha1.

list_revs ($sha1, $count?, $skip?, \%search?, $file?)

Returns a list of revs for the given head ($sha1).

snapshot ($sha1, $format)

Generate an archived snapshot of the repository. $sha1 should be a commit or tree. Returns a filehandle to read from.

diff ($commit, $patch?, $parent?, $file?)

Generate a diff from a given Git::Gitalist::Object.

reflog (@lorgargs)

Return a list of hashes representing each reflog entry.

FIXME Should this return objects?

SEE ALSO

Git::Gitalist::Util Git::Gitalist::Object

AUTHORS

See Git::Gitalist for authors.

LICENSE

See Git::Gitalist for the license.