Representation of a Git commit.

CloneableInstantiable
ExtendsGitonomy\Git\Revision
Methods
public __construct(Gitonomy\Git\Repository $repository, $hash, array $data = [])
 
Constructor.

    public getAuthorDate()
     
    Returns the authoring date.

    • return DateTime A time object
    public getAuthorEmail()
     
    Returns the author email.

    • return string An email
    public getAuthorName()
     
    Returns the author name.

    • return string A name
    public getBodyMessage()
     
    Return the body message.

    • return string The body message
    public getCommit()
     
    {@inheritdoc}

    public getCommitterDate()
     
    Returns the authoring date.

    • return DateTime A time object
    public getCommitterEmail()
     
    Returns the comitter email.

    • return string An email
    public getCommitterName()
     
    Returns the committer name.

    • return string A name
    public getDiff()
     


    • return Diff
    public getFixedShortHash( $length = 6)
     
    Returns a fixed-with short hash.

    public getHash()
     
    Returns the commit hash.

    • return string A SHA1 hash
    public getIncludingBranches( $local = true, $remote = true)
     
    Find branch containing the commit.

    • return array An array of Reference\Branch
    public getLastModification( $path = NULL)
    public Gitonomy\Git\Revision::getLog( $paths = NULL, $offset = NULL, $limit = NULL)
    public getMessage()
     
    Returns the message of the commit.

    • return string A commit message
    public getParentHashes()
     
    Returns parent hashes.

    • return array An array of SHA1 hashes
    public getParents()
     
    Returns the parent commits.

    • return array An array of Commit objects
    public Gitonomy\Git\Revision::getRepository()
    public Gitonomy\Git\Revision::getRevision()
     


    • return string
    public getShortHash()
     
    Returns the short commit hash.

    • return string A SHA1 hash
    public getShortMessage( $length = 50, $preserve = false, $separator = '...')
     
    Returns the first line of the commit, and the first 50 characters.

    • return string
    public getSubjectMessage()
     
    Returns the subject message (the first line).

    • return string The subject message
    public getTree()
    public getTreeHash()
     
    Returns the tree hash.

    • return string A SHA1 hash
    public resolveReferences()
     
    Resolves all references associated to this commit.

    • return array An array of references (Branch, Tag, Squash)
    public setData(array $data)
    Properties
    protected Gitonomy\Git\Revision::$repository
    protected Gitonomy\Git\Revision::$revision
     


    • var string
    Properties
    private $data
     
    Associative array of commit data.

    • var array
    Methods
    private getData( $name)
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only