public interface GitCommandBuilderSupport<B extends GitCommandBuilderSupport<B>>
extends com.atlassian.bitbucket.scm.CommandBuilderSupport<B>
CommandBuilderSupport
and serves as the super-interface describing additional functionality that is
required to be provided by all type-safe git
command builders.Modifier and Type | Field and Description |
---|---|
static String |
ENV_AUTHOR_DATE
An environment variable which overrides the author date when using commands like
git commit or
git merge which create new commits. |
static String |
ENV_AUTHOR_EMAIL |
static String |
ENV_AUTHOR_NAME |
static String |
ENV_COMMITTER_DATE
An environment variable which overrides the committer date when using commands like
git commit
or git merge which create new commits. |
static String |
ENV_COMMITTER_EMAIL |
static String |
ENV_COMMITTER_NAME |
Modifier and Type | Method and Description |
---|---|
B |
alternate(com.atlassian.bitbucket.repository.Repository alternate)
Adds the specified repository as an alternate, giving the command access to all of the repository's objects.
|
B |
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.
|
B |
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.
|
B |
author(com.atlassian.bitbucket.user.ApplicationUser value) |
B |
author(com.atlassian.bitbucket.user.Person value)
NOTE: Instances of
ApplicationUser will use ApplicationUser.getDisplayName() , and
anything else will fall back to Person.getName() . |
B |
author(String displayName,
String email) |
<T> GitCommand<T> |
build(com.atlassian.bitbucket.scm.CommandOutputHandler<T> outputHandler)
In addition to all contracts for
the parent
interface , mandates that built commands be GitCommands , which support both synchronous
and asynchronous execution, rather than simple Commands . |
B |
committer(com.atlassian.bitbucket.user.ApplicationUser value) |
B |
committer(com.atlassian.bitbucket.user.Person value)
NOTE: Instances of
ApplicationUser will use ApplicationUser.getDisplayName() , and
anything else will fall back to Person.getName() . |
B |
committer(String displayName,
String email) |
B |
withConfiguration(String key)
A convenience shorthand for
withConfiguration(key, true) . |
B |
withConfiguration(String key,
boolean value)
Configures the specified key to either
true or false . |
B |
withConfiguration(String key,
long value)
Configures the specified key to the provided numeric value.
|
B |
withConfiguration(String key,
String value)
Configures the specified key with the provided value.
|
static final String ENV_AUTHOR_DATE
git commit
or
git merge
which create new commits.static final String ENV_AUTHOR_EMAIL
static final String ENV_AUTHOR_NAME
static final String ENV_COMMITTER_DATE
git commit
or git merge
which create new commits.static final String ENV_COMMITTER_EMAIL
static final String ENV_COMMITTER_NAME
@Nonnull B alternate(@Nonnull com.atlassian.bitbucket.repository.Repository alternate)
alternate
- the alternate repository to addthis
@Nonnull B alternates(@Nonnull Iterable<com.atlassian.bitbucket.repository.Repository> alternates)
alternates
- a collection of repositories to add as alternatesthis
@Nonnull B alternates(@Nonnull com.atlassian.bitbucket.repository.Repository alternate, @Nonnull com.atlassian.bitbucket.repository.Repository... alternates)
alternate
- an alternate repository to addalternates
- zero or more additional alternate repositories to addthis
@Nonnull B author(@Nonnull com.atlassian.bitbucket.user.ApplicationUser value)
value
- the user to record as the authorthis
@Nonnull B author(@Nonnull com.atlassian.bitbucket.user.Person value)
ApplicationUser
will use ApplicationUser.getDisplayName()
, and
anything else will fall back to Person.getName()
.value
- the person to record as the authorthis
@Nonnull B author(@Nonnull String displayName, @Nonnull String email)
displayName
- the author's nameemail
- the author's e-mail addressthis
@Nonnull <T> GitCommand<T> build(@Nonnull com.atlassian.bitbucket.scm.CommandOutputHandler<T> outputHandler)
the parent
interface
, mandates that built commands be GitCommands
, which support both synchronous
and asynchronous execution, rather than simple Commands
.build
in interface com.atlassian.bitbucket.scm.CommandBuilderSupport<B extends GitCommandBuilderSupport<B>>
T
- The type of object, or object graph, which the output handler will process from the command's outputoutputHandler
- the handler to receive and process output from the command as it executesNullPointerException
- if the provided outputHandler
is null
@Nonnull B committer(@Nonnull com.atlassian.bitbucket.user.ApplicationUser value)
value
- the user to record as the committerthis
@Nonnull B committer(@Nonnull com.atlassian.bitbucket.user.Person value)
ApplicationUser
will use ApplicationUser.getDisplayName()
, and
anything else will fall back to Person.getName()
.value
- the person to record as the committerthis
@Nonnull B committer(@Nonnull String displayName, @Nonnull String email)
displayName
- the committer's nameemail
- the committer's e-mail addressthis
@Nonnull B withConfiguration(@Nonnull String key)
withConfiguration(key, true)
. This
emulates the behavior of git -c key
, where no =value
is specified.key
- the configuration key to set, with sub-keys separated by dots (e.g. "gc.auto"
this
@Nonnull B withConfiguration(@Nonnull String key, boolean value)
true
or false
.key
- the configuration key to set, with sub-keys separated by dots (e.g. "gc.auto"
value
- true
or false
this
@Nonnull B withConfiguration(@Nonnull String key, long value)
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 a String
for the command linethis
@Nonnull B withConfiguration(@Nonnull String key, @Nullable String value)
null
or ""
(empty), the key will be set to the empty string. This emulates the behavior of git config -c key=
,
where no value
is provided after the =
sign.
Unlike git config
, it is not possible to explicitly declare the type of
value being set when using git -c
. The values provided here need to be coercible to whatever type
git
expects or the command will fail when it's called
.
withConfiguration(String, boolean)
and withConfiguration(String, long)
are both convenience
wrappers around this method which will perform the String
conversion. To the command
there 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
implicit true
semantics, you must call that method.
key
- the configuration key to set, with sub-keys separated by dots (e.g. "gc.auto"
value
- the value to set, which may be null
or ""
(empty)this
Copyright © 2019 Atlassian. All rights reserved.