Interface GitScmCommandBuilder
- All Superinterfaces:
com.atlassian.bitbucket.scm.CommandBuilder<GitScmCommandBuilder>,com.atlassian.bitbucket.scm.CommandBuilderSupport<GitScmCommandBuilder>,GitCommandBuilderSupport<GitScmCommandBuilder>,GitTypedCommandBuilder<GitScmCommandBuilder>,com.atlassian.bitbucket.scm.ScmCommandBuilder<GitScmCommandBuilder>
ScmCommandBuilder with git-specific type-safe builders, to simplify using well-known
commands.
Type-safe builders are not provided for all of the commands supported by the git binary, and the builders
that are provided may not expose properties for all of the different arguments or argument combinations the command
offers. Free-form and type-safe builder semantics may not be mixed. If a type-safe builder does not exist for
the desired command, or it does not support the desired arguments, the free-form builder must be used instead.
For type-safe builders provided, the git command associated with the builder is used to name the interface
and the method. Note that some commands accept arguments which, when provided, enable the use of other arguments, or
trigger the command to produce significantly different output. For such commands, like blame and
cat-file, an interim interface is returned to allow the caller to choose the "mode" the command
will run in. Once a mode has been chosen, a builder will be returned exposing arguments supported for that mode.
-
Field Summary
Fields inherited from interface com.atlassian.bitbucket.scm.git.command.GitCommandBuilderSupport
ENV_AUTHOR_DATE, ENV_AUTHOR_EMAIL, ENV_AUTHOR_NAME, ENV_COMMITTER_DATE, ENV_COMMITTER_EMAIL, ENV_COMMITTER_NAME -
Method Summary
Modifier and TypeMethodDescriptionarchive()blame()branch()<T> GitCommand<T>build(com.atlassian.bitbucket.scm.CommandOutputHandler<T> outputHandler) In addition to all contracts forthe parent interface, mandates that built commands beGitCommands, which support both synchronous and asynchronous execution, rather than simpleCommands.catFile()diff()diffTree()fetch()log()lsFiles()lsTree()notes()push()revList()tag()com.atlassian.bitbucket.util.Versionversion()Retrieves theversionof the current git binary, if an acceptable version is installed.Methods inherited from interface com.atlassian.bitbucket.scm.CommandBuilder
argument, argumentAfter, argumentAt, argumentBefore, clearArguments, clearInputHandler, defaultErrorHandler, errorHandler, inputHandler, rawArgument, rawArgumentAfter, rawArgumentAt, rawArgumentBeforeMethods inherited from interface com.atlassian.bitbucket.scm.CommandBuilderSupport
clearEnvironment, defaultExitHandler, exitHandler, removeEnvironment, withEnvironmentMethods inherited from interface com.atlassian.bitbucket.scm.git.command.GitCommandBuilderSupport
alternate, alternates, alternates, author, author, author, commitish, committer, committer, committer, treeish, withConfiguration, withConfiguration, withConfiguration, withConfigurationMethods inherited from interface com.atlassian.bitbucket.scm.ScmCommandBuilder
command
-
Method Details
-
archive
- Specified by:
archivein interfaceGitTypedCommandBuilder<GitScmCommandBuilder>- Returns:
- a builder for the
git archivecommand - Since:
- 5.1
-
blame
- Specified by:
blamein interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
branch
- Specified by:
branchin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
build
@Nonnull <T> GitCommand<T> build(@Nonnull com.atlassian.bitbucket.scm.CommandOutputHandler<T> outputHandler) Description copied from interface:GitCommandBuilderSupportIn addition to all contracts forthe parent interface, mandates that built commands beGitCommands, which support both synchronous and asynchronous execution, rather than simpleCommands.- Specified by:
buildin interfacecom.atlassian.bitbucket.scm.CommandBuilderSupport<GitScmCommandBuilder>- Specified by:
buildin interfaceGitCommandBuilderSupport<GitScmCommandBuilder>- Specified by:
buildin interfacecom.atlassian.bitbucket.scm.ScmCommandBuilder<GitScmCommandBuilder>- Type Parameters:
T- The type of object, or object graph, which the output handler will process from the command's output- Parameters:
outputHandler- the handler to receive and process output from the command as it executes- Returns:
- the built command
-
catFile
- Specified by:
catFilein interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
checkRefFormat
- Specified by:
checkRefFormatin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>- Returns:
- a type-safe parent builder for the
git check-ref-formatcommand
-
countObjects
- Specified by:
countObjectsin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
diff
- Specified by:
diffin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
diffTree
- Specified by:
diffTreein interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
fetch
- Specified by:
fetchin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
forEachRef
- Specified by:
forEachRefin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
formatPatch
- Specified by:
formatPatchin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>- Returns:
- a builder for the
git format-patchcommand - Since:
- 6.7
-
log
- Specified by:
login interfaceGitTypedCommandBuilder<GitScmCommandBuilder>- Returns:
- the git log builder
- Since:
- 4.5
-
lsFiles
- Specified by:
lsFilesin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
lsTree
- Specified by:
lsTreein interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
mergeBase
- Specified by:
mergeBasein interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
notes
- Specified by:
notesin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
packObjects
- Specified by:
packObjectsin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
push
- Specified by:
pushin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
revList
- Specified by:
revListin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
tag
- Specified by:
tagin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>- Returns:
- a builder for the
git tagcommand
-
updateRef
- Specified by:
updateRefin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>
-
version
@Nonnull com.atlassian.bitbucket.util.Version version()Description copied from interface:GitTypedCommandBuilderRetrieves theversionof the current git binary, if an acceptable version is installed. Ifgitwas not found, or if it is not an acceptable version, an exception is thrown.This method should only be used after system startup is complete. For example, it should not be called in constructors, as doing so may result in an exception that causes the plugin to fail to start.
- Specified by:
versionin interfaceGitTypedCommandBuilder<GitScmCommandBuilder>- Returns:
- the
gitversion in use, if an acceptable version is installed; otherwise, an exception is thrown - Since:
- 7.14
-