Enum Class GitMergeFastForward
- All Implemented Interfaces:
Serializable
,Comparable<GitMergeFastForward>
,Constable
git merge
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUses the default fast-forward setting forgit merge
, which is generallyON
.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 TypeMethodDescriptiongetFlag()
boolean
Indicates whether this fast-forward setting has a specificflag
for use withgit merge
.static GitMergeFastForward
Returns the enum constant of this class with the specified name.static GitMergeFastForward[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
-
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
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 onsquash
merges, which always produce a new non-merge commit even if the branch pointer can be fast-forwarded. -
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
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
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 nameNullPointerException
- if the argument is null
-
getFlag
-
isFlagged
public boolean isFlagged()Indicates whether this fast-forward setting has a specificflag
for use withgit merge
. Thedefault
mode does not require a flag.- Returns:
true
if this setting has aflag
; otherwise,false
-