PHP Class Bart\Git\Commit

Datei anzeigen Open project: box/bart Class Usage Examples

Public Methods

Method Description
__construct ( Bart\Git\GitRoot $root, string $revision, string $projectName = null )
__toString ( ) : string
author ( ) : Person The author of the commit (person who originally wrote the work)
committer ( ) : Person The committer of the commit (person who last applied the work)
gerritChangeId ( ) : string
getProjectName ( ) : string
jiras ( ) : Bart\Jira\JiraIssue[]
message ( )
messageFull ( ) : string
messageRawBody ( ) : string
messageSubject ( ) : string
rawFileContents ( string $filePath ) : string
revision ( ) : string

Private Methods

Method Description
gitShowFormatOutput ( string $format, string $exceptionMsg ) : string The output from git show with a specific format (--format={$format} flag) and suppressed diff output (-s flag)

Method Details

__construct() public method

public __construct ( Bart\Git\GitRoot $root, string $revision, string $projectName = null )
$root Bart\Git\GitRoot Root of repo on disk
$revision string The revision label of commit, typically the hash.
$projectName string Project in which commit was made. This defaults to `null` for backwards compatibility See `man git-rev-parse` "SPECIFYING REVISIONS" for valid names

__toString() public method

public __toString ( ) : string
return string

author() public method

The author of the commit (person who originally wrote the work)
public author ( ) : Person
return Person

committer() public method

The committer of the commit (person who last applied the work)
public committer ( ) : Person
return Person

gerritChangeId() public method

public gerritChangeId ( ) : string
return string Gerrit Change-Id

getProjectName() public method

public getProjectName ( ) : string
return string Name of the repository in which commit was made. This may or may not include the ".git" suffix

jiras() public method

public jiras ( ) : Bart\Jira\JiraIssue[]
return Bart\Jira\JiraIssue[] Any matched Jira Issue from commit message

message() public method

Deprecation: {@see \self::messageFull()}
public message ( )

messageFull() public method

public messageFull ( ) : string
return string The full commit log message

messageRawBody() public method

public messageRawBody ( ) : string
return string The unwrapped subject and body of the commit message (just the log message, not the author, etc.)

messageSubject() public method

public messageSubject ( ) : string
return string The first non-blank lines of the commit message

rawFileContents() public method

public rawFileContents ( string $filePath ) : string
$filePath string the path to the file from the project root
return string The raw contents of the file

revision() public method

public revision ( ) : string
return string Revision revision