Enum Class GitMergeFastForward

java.lang.Object
java.lang.Enum<GitMergeFastForward>
com.atlassian.bitbucket.scm.git.command.merge.GitMergeFastForward
All Implemented Interfaces:
Serializable, Comparable<GitMergeFastForward>, Constable

public enum GitMergeFastForward extends Enum<GitMergeFastForward>
Describes the possible fast-forward settings for git merge.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Uses the default fast-forward setting for git merge, which is generally ON.
    Always create a merge commit, even if merge target is an ancestor of the commit being merged, meaning the branch pointer could simply be fast-forwarded to the incoming commit without performing a merge.
    Only create a merge commit if the merge target is not an ancestor of the commit being merged, meaning it is not possible to fast-forward the branch pointer.
    Fail if a merge commit would be created, only allowing the "merge" to be performed if the merge target is an ancestor of the commit being merged.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    Indicates whether this fast-forward setting has a specific flag for use with git merge.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DEFAULT

      public static final GitMergeFastForward DEFAULT
      Uses the default fast-forward setting for git merge, which is generally ON. Note that --squash merges apply ON differently; see that constant for details.
    • OFF

      public static final GitMergeFastForward OFF
      Always create a merge commit, even if merge target is an ancestor of the commit being merged, meaning the branch pointer could simply be fast-forwarded to the incoming commit without performing a merge.

      This is the default merge behaviour for normal merges unless explicitly configured otherwise.

    • ON

      public static final GitMergeFastForward ON
      Only create a merge commit if the merge target is not an ancestor of the commit being merged, meaning it is not possible to fast-forward the branch pointer.

      When using this mode with a normal merge, any commit message or other configuration applied to the merge command will have no effect if the merge can be accomplished by fast-forwarding the branch pointer since no commit is created. This mode has no effect on squash merges, which always produce a new non-merge commit even if the branch pointer can be fast-forwarded.

    • ONLY

      public static final GitMergeFastForward ONLY
      Fail if a merge commit would be created, only allowing the "merge" to be performed if the merge target is an ancestor of the commit being merged.

      For normal merges this mode will never create a merge commit. As a result, any commit message or other configuration applied to the merge command will always be ignored.

      For squash merges this mode will trigger the merge to fail if the source branch is not fast-forward from the target. However, a new commit will always be created--the branch pointer will never be fast-forwarded. The new commit will reference the same tree as the source commit (so it will contain exactly the same changes), but will have its own author and committer details and commit message.

  • Method Details

    • values

      public static GitMergeFastForward[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GitMergeFastForward valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFlag

      @Nullable public String getFlag()
    • isFlagged

      public boolean isFlagged()
      Indicates whether this fast-forward setting has a specific flag for use with git merge. The default mode does not require a flag.
      Returns:
      true if this setting has a flag; otherwise, false