public final enum

GitMergeFastForward

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.atlassian.bitbucket.scm.git.command.merge.GitMergeFastForward

Class Overview

Describes the possible fast-forward settings for git merge.

Summary

Enum Values
GitMergeFastForward  DEFAULT  Uses the default fast-forward setting for git merge, which is generally ON
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. 
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. 
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. 
Public Methods
@Nullable String getFlag()
boolean isFlagged()
Indicates whether this fast-forward setting has a specific flag for use with git merge.
static GitMergeFastForward valueOf(String name)
final static GitMergeFastForward[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

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.

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.

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.

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.

Public Methods

@Nullable public String getFlag ()

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

public static GitMergeFastForward valueOf (String name)

public static final GitMergeFastForward[] values ()