PHP Class Gitamin\Services\Git\Repository

Inheritance: extends Gitter\Repository
Show file Open project: gitaminhq/gitamin Class Usage Examples

Public Methods

Method Description
createArchive ( string $tree, string $output, string $format = 'zip' ) Create a TAR or ZIP archive of a git tree.
getAuthorStatistics ( $branch )
getBlame ( string $file ) : array Blames the provided file and parses the output.
getCommit ( string $commitHash ) : array Show the data from a specific commit.
getHead ( $default = null ) Get the current branch, returning a default value when HEAD is detached.
getLatestCommit ( $file = null )
getPaginatedCommits ( string $file = null, $page ) : array Show the repository commit log with pagination.
getStatistics ( $branch )
hasCommit ( $commitHash ) : boolean Return true if the repo contains this commit.
pathExists ( string $commitish, string $path ) : boolean Return true if $path exists in $branch; return false otherwise.
readDiffLogs ( array $logs ) : array Read diff logs and generate a collection of diffs.
searchCommitLog ( $query, $branch )
searchTree ( $query, $branch )

Method Details

createArchive() public method

Create a TAR or ZIP archive of a git tree.
public createArchive ( string $tree, string $output, string $format = 'zip' )
$tree string Tree-ish reference
$output string Output File name
$format string Archive format

getAuthorStatistics() public method

public getAuthorStatistics ( $branch )

getBlame() public method

Blames the provided file and parses the output.
public getBlame ( string $file ) : array
$file string File that will be blamed
return array Commits hashes containing the lines

getCommit() public method

Show the data from a specific commit.
public getCommit ( string $commitHash ) : array
$commitHash string Hash of the specific commit to read data
return array Commit data

getHead() public method

Get the current branch, returning a default value when HEAD is detached.
public getHead ( $default = null )

getLatestCommit() public method

public getLatestCommit ( $file = null )

getPaginatedCommits() public method

Show the repository commit log with pagination.
public getPaginatedCommits ( string $file = null, $page ) : array
$file string
return array Commit log

getStatistics() public method

public getStatistics ( $branch )

hasCommit() public method

Return true if the repo contains this commit.
public hasCommit ( $commitHash ) : boolean
$commitHash Hash of commit whose existence we want to check
return boolean Whether or not the commit exists in this repo

pathExists() public method

Return true if $path exists in $branch; return false otherwise.
public pathExists ( string $commitish, string $path ) : boolean
$commitish string Commitish reference; branch, tag, SHA1, etc.
$path string Path whose existence we want to verify.
return boolean GRIPE Arguably belongs in Gitter, as it's generally useful functionality. Also, this really may not be the best way to do this.

readDiffLogs() public method

Read diff logs and generate a collection of diffs.
public readDiffLogs ( array $logs ) : array
$logs array Array of log rows
return array Array of diffs

searchCommitLog() public method

public searchCommitLog ( $query, $branch )

searchTree() public method

public searchTree ( $query, $branch )