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>

public interface GitCommandBuilderSupport<B extends GitCommandBuilderSupport<B>> extends com.atlassian.bitbucket.scm.CommandBuilderSupport<B>
Extends 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    An environment variable which overrides the author date when using commands like git commit or git merge which create new commits.
    static final String
     
    static final String
     
    static final String
    An environment variable which overrides the committer date when using commands like git commit or git merge which create new commits.
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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 of ApplicationUser will use ApplicationUser.getDisplayName(), and anything else will fall back to Person.getName().
    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.
    Appends a commit-ish argument to the command.
    committer(com.atlassian.bitbucket.user.ApplicationUser value)
     
    committer(com.atlassian.bitbucket.user.Person value)
    NOTE: Instances of ApplicationUser will use ApplicationUser.getDisplayName(), and anything else will fall back to Person.getName().
    committer(String displayName, String email)
     
    treeish(String value)
    Appends a tree-ish argument to the command.
    A convenience shorthand for withConfiguration(key, true).
    withConfiguration(String key, boolean value)
    Configures the specified key to either true or false.
    withConfiguration(String key, long value)
    Configures the specified key to the provided numeric 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

  • Method Details

    • alternate

      @Nonnull B alternate(@Nonnull com.atlassian.bitbucket.repository.Repository 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

      @Nonnull B alternates(@Nonnull 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.
      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 add
      alternates - zero or more additional alternate repositories to add
      Returns:
      this
      Since:
      6.0
    • author

      @Nonnull B author(@Nonnull com.atlassian.bitbucket.user.ApplicationUser value)
      Parameters:
      value - the user to record as the author
      Returns:
      this
    • author

      @Nonnull B author(@Nonnull com.atlassian.bitbucket.user.Person value)
      NOTE: Instances of ApplicationUser will use ApplicationUser.getDisplayName(), and anything else will fall back to Person.getName().
      Parameters:
      value - the person to record as the author
      Returns:
      this
    • author

      @Nonnull B author(@Nonnull String displayName, @Nonnull String email)
      Parameters:
      displayName - the author's name
      email - 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 for the parent interface, mandates that built commands be GitCommands, which support both synchronous and asynchronous execution, rather than simple Commands.
      Specified by:
      build in interface com.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 provided outputHandler is null
    • commitish

      @Nonnull B commitish(@Nonnull String value)
      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^ or HEAD~12.

      Parameters:
      value - the commit-ish value to append
      Returns:
      this
      Since:
      7.14
    • committer

      @Nonnull B committer(@Nonnull com.atlassian.bitbucket.user.ApplicationUser value)
      Parameters:
      value - the user to record as the committer
      Returns:
      this
    • committer

      @Nonnull B committer(@Nonnull com.atlassian.bitbucket.user.Person value)
      NOTE: Instances of ApplicationUser will use ApplicationUser.getDisplayName(), and anything else will fall back to Person.getName().
      Parameters:
      value - the person to record as the committer
      Returns:
      this
      Since:
      5.0
    • committer

      @Nonnull B committer(@Nonnull String displayName, @Nonnull String email)
      Parameters:
      displayName - the committer's name
      email - the committer's e-mail address
      Returns:
      this
    • treeish

      @Nonnull B treeish(@Nonnull String value)
      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

      @Nonnull B withConfiguration(@Nonnull String key)
      A convenience shorthand for withConfiguration(key, true). This emulates the behavior of git -c key, where no =value is specified.
      Parameters:
      key - the configuration key to set, with sub-keys separated by dots (e.g. "gc.auto"
      Returns:
      this
      Since:
      4.8
    • withConfiguration

      @Nonnull B withConfiguration(@Nonnull String key, boolean value)
      Configures the specified key to either true or false.
      Parameters:
      key - the configuration key to set, with sub-keys separated by dots (e.g. "gc.auto"
      value - true or false
      Returns:
      this
      Since:
      4.8
    • withConfiguration

      @Nonnull B withConfiguration(@Nonnull String key, long value)
      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 a String for the command line
      Returns:
      this
      Since:
      4.8
    • withConfiguration

      @Nonnull B withConfiguration(@Nonnull String key, @Nullable String value)
      Configures the specified key with the provided value. If the provided value is 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.

      Parameters:
      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)
      Returns:
      this
      Since:
      4.8