Philippe Bruhat (BooK)
and 2 contributors

NAME

Git::Database::Object::Commit - A commit object in the Git object database

VERSION

version 0.007

SYNOPSIS

    my $r      = Git::Database->new();       # current Git repository
    my $commit = $r->get_object('ef25e8');   # abbreviated digest

    # attributes
    $commit->kind;              # commit
    $commit->digest;            # ef25e81ba86b7df16956c974c8a9c1ff2eca1326
    $commit->tree_digest;       # b52168be5ea341e918a9cbbb76012375170a439f
    $commit->parents_digest;    # []
    ...;                        # etc., see below

DESCRIPTION

Git::Database::Object::Commit represents a commit object obtained via Git::Database from a Git object database.

ATTRIBUTES

All major attributes ("digest", "content", "size", "commit_info") have a predicate method.

kind

The object kind: commit.

digest

The SHA-1 digest of the commit object.

content

The object's actual content.

size

The size (in bytes) of the object content.

commit_info

A hash reference containing the all the attributes listed below, as values for the keys with the same names.

tree_digest

The SHA-1 digest of the tree object corresponding to the commit.

parents_digest

An array reference containing the list of SHA-1 digests of the commit's parents.

author

A Git::Database::Actor object representing the author of the commit.

author_date

A DateTime object representing the date at which the author created the commit.

committer

A Git::Database::Actor object representing the committer of the commit.

committer_date

A DateTime object representing the date at which the committer created the commit.

comment

The text of the commit message.

encoding

The encoding of the commit message.

METHODS

new()

Create a new Git::Object::Database::Commit object.

One (and only one) of the content or commit_info arguments is required.

commit_info is a reference to a hash containing the keys listed above, i.e. tree_digest, author, author_date, committer, committed_date, comment, and encoding (optional).

SEE ALSO

Git::Database, Git::Database::Role::Object.

AUTHOR

Philippe Bruhat (BooK) <book@cpan.org>.

COPYRIGHT

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