Interface GitCommandBuilderSupport<B extends GitCommandBuilderSupport<B>>
- All Superinterfaces:
com.atlassian.bitbucket.scm.CommandBuilderSupport<B>
- All Known Subinterfaces:
GitAddBuilder,GitArchiveBuilder,GitBlameBuilder,GitBranchCreateBuilder,GitBranchDeleteBuilder,GitCatFileBatchBuilder,GitCatFileBuilder,GitCheckRefFormatBuilder,GitCommitBuilder,GitConfigGetAllBuilder,GitConfigGetBuilder,GitConfigListBuilder,GitConfigRemoveSectionBuilder,GitConfigRenameSectionBuilder,GitConfigSetBuilder,GitConfigUnsetAllBuilder,GitConfigUnsetBuilder,GitCountObjectsBuilder,GitDiffBuilder,GitDiffCoreBuilder<B>,GitDiffTreeBuilder,GitFetchBuilder,GitForEachRefBuilder,GitFormatPatchBuilder,GitLogBuilder,GitLsFilesBuilder,GitLsTreeBuilder,GitMergeBaseBuilder,GitMergeBaseBuilderSupport<B>,GitMergeBaseIndependentBuilder,GitMergeBuilder,GitMergeBuilderSupport<B>,GitMvBuilder,GitNotesAddBuilder,GitNotesBuilderSupport<B>,GitNotesRemoveBuilder,GitNotesShowBuilder,GitPackObjectsBuilder,GitPushBuilder,GitRemoteAddBuilder,GitRemoteRmBuilder,GitRemoteSetUrlBuilder,GitResetBuilder,GitRevCoreBuilder<B>,GitRevListBuilder,GitRmBuilder,GitScmCommandBuilder,GitSquashMergeBuilder,GitStatusBuilder,GitTagCreateBuilder,GitTagDeleteBuilder,GitTypedCommandBuilder<B>,GitUpdateRefBuilderSupport<B>,GitUpdateRefDeleteBuilder,GitUpdateRefSetBuilder,GitWorkTreeCommandBuilder,TypedGitConfigBuilder<T>
CommandBuilderSupport and serves as the super-interface describing additional functionality that is
required to be provided by all type-safe git command builders.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn environment variable which overrides the author date when using commands likegit commitorgit mergewhich create new commits.static final Stringstatic final Stringstatic final StringAn environment variable which overrides the committer date when using commands likegit commitorgit mergewhich create new commits.static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionalternate(com.atlassian.bitbucket.repository.Repository alternate) Adds the specified repository as an alternate, giving the command access to all of the repository's objects.alternates(com.atlassian.bitbucket.repository.Repository alternate, com.atlassian.bitbucket.repository.Repository... alternates) Adds all of the specified repositories as alternates, giving the command access to all of the repositories' objects.alternates(Iterable<com.atlassian.bitbucket.repository.Repository> alternates) Adds all of the specified repositories as alternates, giving the command access to all of the repositories' objects.author(com.atlassian.bitbucket.user.ApplicationUser value) author(com.atlassian.bitbucket.user.Person value) NOTE: Instances ofApplicationUserwill useApplicationUser.getDisplayName(), and anything else will fall back toPerson.getName().<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.Appends a commit-ish argument to the command.committer(com.atlassian.bitbucket.user.ApplicationUser value) committer(com.atlassian.bitbucket.user.Person value) NOTE: Instances ofApplicationUserwill useApplicationUser.getDisplayName(), and anything else will fall back toPerson.getName().Appends a tree-ish argument to the command.withConfiguration(String key) A convenience shorthand forwithConfiguration(key, true).withConfiguration(String key, boolean value) Configures the specified key to eithertrueorfalse.withConfiguration(String key, long value) Configures the specified key to the provided numeric value.withConfiguration(String key, String value) Configures the specified key with the provided value.Methods inherited from interface com.atlassian.bitbucket.scm.CommandBuilderSupport
clearEnvironment, defaultExitHandler, exitHandler, removeEnvironment, withEnvironment
-
Field Details
-
ENV_AUTHOR_DATE
An environment variable which overrides the author date when using commands likegit commitorgit mergewhich create new commits.- See Also:
-
ENV_AUTHOR_EMAIL
- See Also:
-
ENV_AUTHOR_NAME
- See Also:
-
ENV_COMMITTER_DATE
An environment variable which overrides the committer date when using commands likegit commitorgit mergewhich create new commits.- See Also:
-
ENV_COMMITTER_EMAIL
- See Also:
-
ENV_COMMITTER_NAME
- See Also:
-
-
Method Details
-
alternate
Adds the specified repository as an alternate, giving the command access to all of the repository's objects.- Parameters:
alternate- the alternate repository to add- Returns:
this- Since:
- 6.0
-
alternates
Adds all of the specified repositories as alternates, giving the command access to all of the repositories' objects.- Parameters:
alternates- a collection of repositories to add as alternates- Returns:
this- Since:
- 4.8
-
alternates
@Nonnull B alternates(@Nonnull com.atlassian.bitbucket.repository.Repository alternate, @Nonnull com.atlassian.bitbucket.repository.Repository... alternates) Adds all of the specified repositories as alternates, giving the command access to all of the repositories' objects.- Parameters:
alternate- an alternate repository to addalternates- zero or more additional alternate repositories to add- Returns:
this- Since:
- 6.0
-
author
- Parameters:
value- the user to record as the author- Returns:
this
-
author
NOTE: Instances ofApplicationUserwill useApplicationUser.getDisplayName(), and anything else will fall back toPerson.getName().- Parameters:
value- the person to record as the author- Returns:
this
-
author
- Parameters:
displayName- the author's nameemail- the author's e-mail address- Returns:
this
-
build
@Nonnull <T> GitCommand<T> build(@Nonnull 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.- Specified by:
buildin interfacecom.atlassian.bitbucket.scm.CommandBuilderSupport<B extends GitCommandBuilderSupport<B>>- 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
- Throws:
NullPointerException- if the providedoutputHandlerisnull
-
commitish
Appends a commit-ish argument to the command. This validates that the value does not start with a-, which could potentially be interpreted as a command line option instead of a commit identifier.Definition: A "commit-ish" is a value that can coerced by Git to identify a single commit. A commit's SHA is obviously a commit-ish value, but so are branch and tag names, as well as other other single revision specifiers like
HEAD^orHEAD~12.- Parameters:
value- the commit-ish value to append- Returns:
this- Since:
- 7.14
-
committer
- Parameters:
value- the user to record as the committer- Returns:
this
-
committer
NOTE: Instances ofApplicationUserwill useApplicationUser.getDisplayName(), and anything else will fall back toPerson.getName().- Parameters:
value- the person to record as the committer- Returns:
this- Since:
- 5.0
-
committer
- Parameters:
displayName- the committer's nameemail- the committer's e-mail address- Returns:
this
-
treeish
Appends a tree-ish argument to the command. This validates that the value does not start with a-, which could potentially be interpreted as a command line option instead of a tree identifier.Definition: A "tree-ish" is a value that can be coerced by Git to identify a single tree. A tree's SHA is obviously a tree-ish value, but so are commits (which have a root tree) and branches/tags (which identify commits).
- Parameters:
value- the tree-ish value to append- Returns:
this- Since:
- 7.14
-
withConfiguration
A convenience shorthand forwithConfiguration(key, true). This emulates the behavior ofgit -c key, where no=valueis specified.- Parameters:
key- the configuration key to set, with sub-keys separated by dots (e.g."gc.auto"- Returns:
this- Since:
- 4.8
-
withConfiguration
Configures the specified key to eithertrueorfalse.- Parameters:
key- the configuration key to set, with sub-keys separated by dots (e.g."gc.auto"value-trueorfalse- Returns:
this- Since:
- 4.8
-
withConfiguration
Configures the specified key to the provided numeric value.- Parameters:
key- the configuration key to set, with sub-keys separated by dots (e.g."gc.auto"value- the numeric value to set, which will be converted to aStringfor the command line- Returns:
this- Since:
- 4.8
-
withConfiguration
Configures the specified key with the provided value. If the provided value isnullor""(empty), the key will be set to the empty string. This emulates the behavior ofgit config -c key=, where novalueis provided after the=sign.Unlike
git config, it is not possible to explicitly declare the type of value being set when usinggit -c. The values provided here need to be coercible to whatever typegitexpects or the command will fail when it'scalled.withConfiguration(String, boolean)andwithConfiguration(String, long)are both convenience wrappers around this method which will perform theStringconversion. To thecommandthere is no difference between providing values to those methods or this one.Note that the behavior of
withConfiguration(String)is not possible using this method. To use its implicittruesemantics, you must call that method.- Parameters:
key- the configuration key to set, with sub-keys separated by dots (e.g."gc.auto"value- the value to set, which may benullor""(empty)- Returns:
this- Since:
- 4.8
-