The commit object (VersionControl_Git_Object_Commit)

An instance of the VersionControl_Git_Object_Commit provides information about a commit.

<?php
require_once 'VersionControl/Git.php';

$git = new VersionControl_Git('/path/to/repository');
$commits $git->getCommits();

var_dump($commits[0]->getAuthor());
/*
string(35) "Kousuke Ebihara <kousuke@co3k.org>"
*/

var_dump($commits[0]->getCreatedAt());
/*
object(DateTime)#5 (3) {
}
*/

var_dump($commits[0]->getCommitter());
/*
string(35) "Kousuke Ebihara <kousuke@co3k.org>"
*/

var_dump($commits[0]->getCommittedAt());
/*
object(DateTime)#6 (3) {
}
*/

var_dump($commits[0]->getMessage());
/*
string(62) "changed url to JSON version of dashboard contents (fixes #509)"
*/

var_dump($commits[0]->getParents());
/*
array(1) {
  [0]=>
    object(VersionControl_Git_Object_Commit)#303 (9) {
    }
}
*/

var_dump($commits[0]->getTree());
/*
string(40) "ba2dd3d861f68c6ea31c4cd4444a5d86869a3401"
*/
Getting commits (Previous) The tree object (VersionControl_Git_Object_Tree) (Next)
Last updated: Tue, 22 Apr 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.