Copied!

Representation of a Git commit.

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

Constructor.

  • param \Repository $repository Repository of the commit
  • param string $hash Hash of the commit
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()
 
  • return \Commit
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.

  • return string Short hash
public getHash()
 

Returns the commit hash.

  • return string A SHA1 hash
public getIncludingBranches( $local = true, $remote = true)
 

Find branch containing the commit.

  • param bool $local set true to try to locate a commit on local repository
  • param bool $remote set true to try to locate a commit on remote repository
  • return \Reference[]|\Branch[] An array of Reference\Branch
public getLastModification( $path = NULL)
 
  • return \Commit
public Gitonomy\Git\Revision::getLog( $paths = NULL, $offset = NULL, $limit = NULL)
 
  • return \Log
public getMessage()
 

Returns the message of the commit.

  • return string A commit message
public getParentHashes()
 

Returns parent hashes.

  • return string[] An array of SHA1 hashes
public getParents()
 

Returns the parent commits.

  • return \Commit[] An array of Commit objects
public Gitonomy\Git\Revision::getRepository()
 
  • return \Repository
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.

  • param int $length
  • param bool $preserve
  • param string $separator
  • return string
public getSubjectMessage()
 

Returns the subject message (the first line).

  • return string The subject message
public getTree()
 
  • return \Tree
public getTreeHash()
 

Returns the tree hash.

  • return string A SHA1 hash
public resolveReferences()
 

Resolves all references associated to this commit.

  • return \Reference[] An array of references (Branch, Tag, Squash)
public setData(array $data)
Properties
protected Gitonomy\Git\Revision::$repository = NULL
 
  • var \Repository
protected Gitonomy\Git\Revision::$revision = NULL
 
  • var string
Properties
private $data = []
 

Associative array of commit data.

  • var array
Methods
private getData( $name)
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration