Page MenuHomePhorge

final class ArcanistGitAPI
libphutil Technical Documentation ()

Interfaces with Git working copies.

Tasks

Path Status

Other Methods

scratch

  • public function readScratchFile($path) — Try to read a scratch file, if it exists and is readable.
  • public function writeScratchFile($path, $data) — Try to write a scratch file, if there's somewhere to put it and we can write there.
  • public function removeScratchFile($path) — Try to remove a scratch file.
  • public function getReadableScratchFilePath($path) — Get a human-readable description of the scratch file location.
  • public function getScratchFilePath($path) — Get the path to a scratch file, if possible.

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public function getSourceControlSystemName()

This method is not documented.
Return
wild

public function getDiffLinesOfContext()
Inherited

This method is not documented.
Return
wild

public function setDiffLinesOfContext($lines)
Inherited

This method is not documented.
Parameters
$lines
Return
wild

public function getWorkingCopyIdentity()
Inherited

This method is not documented.
Return
wild

public function getConfigurationManager()
Inherited

This method is not documented.
Return
wild

public static function newAPIFromConfigurationManager($configuration_manager)
Inherited

This method is not documented.
Parameters
ArcanistConfigurationManager$configuration_manager
Return
wild

public function __construct($path)
Inherited

This method is not documented.
Parameters
$path
Return
this//Implicit.//

public function getPath($to_file)
Inherited

This method is not documented.
Parameters
$to_file
Return
wild

protected function buildUncommittedStatus()

This method is not documented.
Return
wild

protected function buildCommitRangeStatus()

This method is not documented.
Return
wild

final public function getUncommittedStatus()
Inherited

ArcanistRepositoryAPI

Get a list of uncommitted paths in the working copy that have been changed or are affected by other status effects, like conflicts or untracked files.

Convenience methods getUntrackedChanges(), getUnstagedChanges(), getUncommittedChanges(), getMergeConflicts(), and getIncompleteChanges() allow simpler selection of paths in a specific state.

This method returns a map of paths to bitmasks with status, using FLAG_ constants. For example:

array(
  'some/uncommitted/file.txt' => ArcanistRepositoryAPI::FLAG_UNSTAGED,
);

A file may be in several states. Not all states are possible with all version control systems.

Return
map<string, bitmask>Map of paths, see above.

final public function getUntrackedChanges()
Inherited

This method is not documented.
Return
wild

final public function getUnstagedChanges()
Inherited

This method is not documented.
Return
wild

final public function getUncommittedChanges()
Inherited

This method is not documented.
Return
wild

final public function getMergeConflicts()
Inherited

This method is not documented.
Return
wild

final public function getIncompleteChanges()
Inherited

This method is not documented.
Return
wild

final public function getMissingChanges()
Inherited

This method is not documented.
Return
wild

final public function getDirtyExternalChanges()
Inherited

This method is not documented.
Return
wild

private function getUncommittedPathsWithMask($mask)
Inherited

This method is not documented.
Parameters
$mask
Return
wild

final public function getCommitRangeStatus()
Inherited

ArcanistRepositoryAPI

Get a list of paths affected by the commits in the current commit range.

See getUncommittedStatus() for a description of the return value.

Return
map<string, bitmask>Map from paths to status.

final public function getWorkingCopyStatus()
Inherited

ArcanistRepositoryAPI

Get a list of paths affected by commits in the current commit range, or uncommitted changes in the working copy. See getUncommittedStatus() or getCommitRangeStatus() to retrieve smaller parts of the status.

See getUncommittedStatus() for a description of the return value.

Return
map<string, bitmask>Map from paths to status.

final public function reloadWorkingCopy()
Inherited

ArcanistRepositoryAPI

Drops caches after changes to the working copy. By default, some queries against the working copy are cached. They

Return
this

protected function didReloadWorkingCopy()
Inherited

ArcanistRepositoryAPI

Hook for implementations to dirty working copy caches after the working copy has been updated.

Return
void

public function getBulkOriginalFileData($paths)
Inherited

ArcanistRepositoryAPI

Fetches the original file data for each path provided.

Parameters
$paths
Return
map<string, string>Map from path to file data.

public function getBulkCurrentFileData($paths)
Inherited

ArcanistRepositoryAPI

Fetches the current file data for each path provided.

Parameters
$paths
Return
map<string, string>Map from path to file data.

public function getAllFiles()

This method is not documented.
Return
Traversable

public function getBlame($path)

This method is not documented.
Parameters
$path
Return
wild

public function getRawDiffText($path, $detect_moves_and_renames)

This method is not documented.
Parameters
$path
Return
wild

public function getOriginalFileData($path)

This method is not documented.
Parameters
$path
Return
wild

public function getCurrentFileData($path)

This method is not documented.
Parameters
$path
Return
wild

public function getLocalCommitInformation()

This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function getCanonicalRevisionName($string)

This method is not documented.
Parameters
$string
Return
wild

public function getBranchName()

This method is not documented.
Return
wild

public function getSourceControlPath()

This method is not documented.
Return
wild

public function isHistoryDefaultImmutable()

This method is not documented.
Return
wild

public function supportsAmend()

This method is not documented.
Return
wild

public function getWorkingCopyRevision()

This method is not documented.
Return
wild

public function updateWorkingCopy()

This method is not documented.
Return
wild

public function getMetadataPath()

This method is not documented.
Return
wild

public function loadWorkingCopyDifferentialRevisions($conduit, $query)

This method is not documented.
Parameters
ConduitClient$conduit
array$query
Return
wild

public function getRemoteURI()

This method is not documented.
Return
wild

public function getChangedFiles($since_commit)

This method is not documented.
Parameters
$since_commit
Return
wild

public function getAuthor()

This method is not documented.
Return
wild

public function addToCommit($paths)

This method is not documented.
Parameters
array$paths
Return
wild

public function supportsLocalCommits()

This method is not documented.
Return
wild

public function doCommit($message)

This method is not documented.
Parameters
$message
Return
wild

public function amendCommit($message)

This method is not documented.
Parameters
$message
Return
wild

public function getBaseCommitRef()

This method is not documented.
Return
wild

public function hasLocalCommit($commit)

This method is not documented.
Parameters
$commit
Return
wild

public function getCommitMessage($commit)

This method is not documented.
Parameters
$commit
Return
wild

public function getCommitSummary($commit)

This method is not documented.
Parameters
$commit
Return
wild

public function getAllLocalChanges()

This method is not documented.
Return
wild

public function getFinalizedRevisionMessage()

This method is not documented.
Return
wild

public function execxLocal($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function execManualLocal($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function execFutureLocal($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

protected function buildLocalFuture($argv)

This method is not documented.
Parameters
array$argv
Return
wild

public function canStashChanges()

This method is not documented.
Return
wild

public function stashChanges()

This method is not documented.
Return
wild

public function unstashChanges()

This method is not documented.
Return
wild

public function readScratchFile($path)
Inherited

ArcanistRepositoryAPI

Try to read a scratch file, if it exists and is readable.

Parameters
string$pathScratch file name.
Return
mixedString for file contents, or false for failure.

public function writeScratchFile($path, $data)
Inherited

ArcanistRepositoryAPI

Try to write a scratch file, if there's somewhere to put it and we can write there.

Parameters
string$pathScratch file name to write.
string$dataData to write.
Return
boolTrue on success, false on failure.

public function removeScratchFile($path)
Inherited

ArcanistRepositoryAPI

Try to remove a scratch file.

Parameters
string$pathScratch file name to remove.
Return
boolTrue if the file was removed successfully.

public function getReadableScratchFilePath($path)
Inherited

ArcanistRepositoryAPI

Get a human-readable description of the scratch file location.

Parameters
string$pathScratch file name.
Return
mixedString, or false on failure.

public function getScratchFilePath($path)
Inherited

ArcanistRepositoryAPI

Get the path to a scratch file, if possible.

Parameters
string$pathScratch file name.
Return
mixedFile path, or false on failure.

public function supportsCommitRanges()

This method is not documented.
Return
wild

final public function setBaseCommit($symbolic_commit)
Inherited

This method is not documented.
Parameters
$symbolic_commit
Return
wild

public function setHeadCommit($symbolic_commit)

This method is not documented.
Parameters
$symbolic_commit
Return
wild

final public function getBaseCommit()
Inherited

This method is not documented.
Return
wild

public function getHeadCommit()

This method is not documented.
Return
wild

final public function reloadCommitRange()
Inherited

This method is not documented.
Return
wild

protected function didReloadCommitRange()

This method is not documented.
Return
wild

protected function buildBaseCommit($symbolic_commit)

This method is not documented.
Parameters
$symbolic_commit
Return
wild

public function getBaseCommitExplanation()
Inherited

This method is not documented.
Return
wild

public function setBaseCommitExplanation($explanation)
Inherited

This method is not documented.
Parameters
$explanation
Return
wild

public function resolveBaseCommitRule($rule, $source)

This method is not documented.
Parameters
$rule
$source
Return
wild

public function setBaseCommitArgumentRules($base_commit_argument_rules)
Inherited

This method is not documented.
Parameters
$base_commit_argument_rules
Return
wild

public function getBaseCommitArgumentRules()
Inherited

This method is not documented.
Return
wild

public function resolveBaseCommit()
Inherited

This method is not documented.
Return
wild

public function getRepositoryUUID()
Inherited

This method is not documented.
Return
wild

final public function newFuture($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function newPassthru($pattern)

This method is not documented.
Parameters
$pattern
Return
wild

final public function execPassthru($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

final public function setRuntime($runtime)
Inherited

This method is not documented.
Parameters
ArcanistRuntime$runtime
Return
wild

final public function getRuntime()
Inherited

This method is not documented.
Return
wild

final protected function getSymbolEngine()
Inherited

This method is not documented.
Return
wild

final public function getCurrentWorkingCopyStateRef()
Inherited

This method is not documented.
Return
wild

protected function newCurrentWorkingCopyStateRef()
Inherited

This method is not documented.
Return
wild

final public function getCurrentCommitRef()
Inherited

This method is not documented.
Return
wild

protected function newCurrentCommitRef()
Inherited

This method is not documented.
Return
wild

protected function newCurrentCommitSymbol()

This method is not documented.
Return
wild

final public function newCommitRef()
Inherited

This method is not documented.
Return
wild

final public function newMarkerRef()
Inherited

This method is not documented.
Return
wild

final public function getLandEngine()
Inherited

This method is not documented.
Return
wild

protected function newLandEngine()

This method is not documented.
Return
wild

final public function getWorkEngine()
Inherited

This method is not documented.
Return
wild

protected function newWorkEngine()

This method is not documented.
Return
wild

final public function getSupportedMarkerTypes()
Inherited

This method is not documented.
Return
wild

protected function newSupportedMarkerTypes()

This method is not documented.
Return
wild

final public function newMarkerRefQuery()
Inherited

This method is not documented.
Return
wild

protected function newMarkerRefQueryTemplate()

This method is not documented.
Return
wild

final public function newRemoteRefQuery()
Inherited

This method is not documented.
Return
wild

protected function newRemoteRefQueryTemplate()

This method is not documented.
Return
wild

final public function newCommitGraphQuery()
Inherited

This method is not documented.
Return
wild

protected function newCommitGraphQueryTemplate()

This method is not documented.
Return
wild

final public function getDisplayHash($hash)
Inherited

This method is not documented.
Parameters
$hash
Return
wild

final public function getNormalizedURI($uri)
Inherited

This method is not documented.
Parameters
$uri
Return
wild

protected function newNormalizedURI($uri)

This method is not documented.
Parameters
$uri
Return
wild

final public function getPublishedCommitHashes()
Inherited

This method is not documented.
Return
wild

protected function newPublishedCommitHashes()

This method is not documented.
Return
wild

final public function getGraph()
Inherited

This method is not documented.
Return
wild

public function getGitVersion()

This method is not documented.
Return
wild

public function getHasCommits()

This method is not documented.
Return
wild

private function isDescendant($child, $parent)

Tests if a child commit is descendant of a parent commit. If child and parent are the same, it returns false.

Parameters
Child$childcommit SHA.
Parent$parentcommit SHA.
Return
boolTrue if the child is a descendant of the parent.

private function resolveCommit($symbolic_commit)

Translates a symbolic commit (like "HEAD^") to a commit identifier.

Parameters
string_symbol$symbolic_commitcommit.
Return
stringthe commit SHA.

private function getDiffFullOptions($detect_moves_and_renames)

This method is not documented.
Parameters
$detect_moves_and_renames
Return
wild

private function getDiffBaseOptions()

This method is not documented.
Return
wild

public function getFullGitDiff($base, $head)

This method is not documented.
Parameters
the$basebase revision
head$headrevision. If this is null, the generated diff will include the working copy
Return
wild

private function getBranchNameFromRef($ref)

This method is not documented.
Parameters
$ref
Return
wild

public function getGitCommitLog()

This method is not documented.
Return
wild

public function getGitHistoryLog()

This method is not documented.
Return
wild

private function executeSVNFindRev($input, $vcs)

This method is not documented.
Parameters
$input
$vcs
Return
wild

public function getHashFromFromSVNRevisionNumber($revision_id)

This method is not documented.
Parameters
$revision_id
Return
wild

public function getSVNRevisionNumberFromHash($hash)

This method is not documented.
Parameters
$hash
Return
wild
This method is not documented.
Return
wild

public function getGitConfig($key, $default)

This method is not documented.
Parameters
$key
$default
Return
wild

private function parseGitRawDiff($status, $full)

This method is not documented.
Parameters
$status
$full
Return
wild

private function parseGitTree($stdout)

This method is not documented.
Parameters
$stdout
Return
wild

private function getFileDataAtRevision($path, $revision)

This method is not documented.
Parameters
$path
$revision
Return
wild

private function getAllBranches()

Returns names of all the branches in the current repository.

Return
list<dict<string, string>>Dictionary of branch information.

public function isGitSubversionRepo()

This method is not documented.
Return
wild

public function getPathToUpstream($start)

Follow the chain of tracking branches upstream until we reach a remote or cycle locally.

Parameters
string$startRef to start from.
Return
ArcanistGitUpstreamPathPath to an upstream.

public function isPerforceRemote($remote_name)

This method is not documented.
Parameters
$remote_name
Return
wild

public function isPushableRemote($remote_name)

This method is not documented.
Parameters
$remote_name
Return
wild

public function isFetchableRemote($remote_name)

This method is not documented.
Parameters
$remote_name
Return
wild

private function getGitRemoteFetchURI($remote_name)

This method is not documented.
Parameters
$remote_name
Return
wild

private function getGitRemotePushURI($remote_name)

This method is not documented.
Parameters
$remote_name
Return
wild

private function getGitRemoteURI($remote_name, $for_push)

This method is not documented.
Parameters
$remote_name
$for_push
Return
wild

private function loadGitRemoteURI($remote_name, $for_push)

This method is not documented.
Parameters
$remote_name
$for_push
Return
wild

public function isGitLFSWorkingCopy()

This method is not documented.
Return
wild

public function newLocalState()

This method is not documented.
Return
wild

public function readRawCommit($hash)

This method is not documented.
Parameters
$hash
Return
wild

public function writeRawCommit($commit)

This method is not documented.
Parameters
ArcanistGitRawCommit$commit
Return
wild