Method |
Description |
|
__construct ( string $workingDirectoryRoot, string $tempDirectory = null, string $commitMessagePrefix = "[VP] ", string $gitBinary = "git" ) |
|
|
abortRevert ( ) |
Aborts a revert, e.g., if there was a conflict |
|
clearWorkingDirectory ( ) : boolean |
Discards all modifications made to files in working directory. |
|
commit ( CommitMessage | string $message, string $authorName, string $authorEmail ) |
Creates a commit. |
|
getChildCommit ( $commitHash ) : mixed |
Returns child (newer) commit. Assumes there is only a single child commit. |
|
getCommit ( $commitHash ) : Commit |
Gets commit object based on its hash |
|
getDiff ( string $hash = null ) : string |
Returns diff for given commit. |
|
getFileInRevision ( $path, $commitHash ) |
|
|
getFileModifications ( $file ) |
|
|
getInitialCommit ( ) : Commit |
Returns the initial (oldest) commit in the repo |
|
getLastCommitHash ( string $options = "" ) : string |
Gets last (most recent) commit hash in the repository, or an empty string is there are no commits. |
|
getModifiedFiles ( string $gitrevisions ) : string[] |
Returns list of files that were modified in given {@link http://git-scm.com/docs/gitrevisions gitrevisions} |
|
getModifiedFilesWithStatus ( string $gitrevisions ) : array |
Like getModifiedFiles() but also returns the status of each file ("A" for added,
"M" for modified, "D" for deleted and "R" for renamed). |
|
getNumberOfCommits ( string $options = "", string $gitrevisions = "" ) : integer |
Counts number of commits |
|
getStatus ( $array = false ) : string | array[string] |
Returns git status in short format, something like: |
|
init ( ) |
Initializes the repository |
|
isCleanWorkingDirectory ( ) : boolean |
Returns true if there are no changes to commit. |
|
isVersioned ( ) : boolean |
True if the working directory is versioned |
|
log ( string $options = "", string $gitrevisions = "" ) : Commit[] |
Returns an array of Commits based on {@link http://git-scm.com/docs/gitrevisions gitrevisions} |
|
revert ( $commitHash ) : boolean |
Reverts a single commit. If there is a conflict, aborts the revert and returns false. |
|
revertAll ( $commitHash ) |
Reverts all changes up to a given commit - performs a "rollback" |
|
setGitProcessTimeout ( integer $gitProcessTimeout ) |
Changes the timeout of {@link \Symfony\Component\Process\Process} |
|
stageAll ( string | null $path = null ) |
Stages all files under the given path. No path = stage all files in whole working directory. |
|
wasCreatedAfter ( $commitHash, $afterWhichCommitHash ) : boolean |
Returns true if $commitHash was created after the $afterWhichCommitHash commit ("after" meaning
that $commitHash is more recent commit, a child of $afterWhat). Same two commits return false. |
|
willCommit ( ) : boolean |
Returns true if there is something to commit |
|