Merge command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to call())
| Modifier and Type | Class and Description |
|---|---|
| public static enum | MergeCommand.
Values for the "merge.conflictStyle" git config. |
| public static enum | MergeCommand.
The modes available for fast forward merges corresponding to the
|
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | |
| private List | |
| private ContentMergeStrategy | |
| private MergeCommand. | |
| private boolean | |
| private MergeStrategy | |
| private String | |
| private ProgressMonitor | |
| private Boolean |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public MergeResult | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| private void | |
| private void | fallBackToConfiguration()
Use values from the configuration if they have not been explicitly defined via the setters |
| public MergeCommand | |
| public MergeCommand | Returns: thisthe Id of a commit which is merged with the current head aCommit)Id of a commit which is to be merged with the current head |
| public MergeCommand | Returns: thisa name of a name, AnyObjectId Ref pointing to the committhe Id of a commit which is merged with the current head aCommit)Include a commit |
| public MergeCommand | Returns: thistrue if this command should commit (this is the
default behavior). false if this command should
not commit. In case the merge was successful but this flag was
set to false a
org. with type
org. with status
org.
is returnedControls whether the merge command should automatically commit after a successful merge |
| public MergeCommand | Returns: thisthe strategy)ContentMergeStrategy to be usedSets the content merge strategy to use if the
|
| public MergeCommand | Returns: thiscorresponds to the --ff/--no-ff/--ff-only options. If
fastForwardModenull use the value of the merge.ff option
configured in git config. If this option is not configured
--ff is the built-in default.Sets the fast forward mode. |
| public MergeCommand | Returns: thiswhether to insert a change id insertChangeId)If set to true a change id will be inserted into the commit message An existing change id is not replaced. |
| public MergeCommand | Returns: thisthe message to be used for the merge commit message)Set the commit message to be used for the merge commit (in case one is created) |
| public MergeCommand | Returns: this instanceA progress monitor monitor)The progress monitor associated with the diff operation. |
| public MergeCommand | Returns: thiswhether to squash commits or not squash)If |
| public MergeCommand | Returns: thisthe mergeStrategy)org. to be usedSet merge strategy |
| private void |
| commit | back to summary |
|---|---|
| private Boolean commit | |
| commits | back to summary |
|---|---|
| private List<Ref> commits | |
| contentStrategy | back to summary |
|---|---|
| private ContentMergeStrategy contentStrategy | |
| fastForwardMode | back to summary |
|---|---|
| private MergeCommand. | |
| insertChangeId | back to summary |
|---|---|
| private boolean insertChangeId | |
| mergeStrategy | back to summary |
|---|---|
| private MergeStrategy mergeStrategy | |
| message | back to summary |
|---|---|
| private String message | |
| monitor | back to summary |
|---|---|
| private ProgressMonitor monitor | |
| squash | back to summary |
|---|---|
| private Boolean squash | |
| MergeCommand | back to summary |
|---|---|
| protected MergeCommand(Repository repo) Constructor for MergeCommand.
| |
| call | back to summary |
|---|---|
| public MergeResult call() throws GitAPIException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, WrongRepositoryStateException, NoMessageException Implements abstract org. Implements java. Doc from org. Computes a result, or throws an exception if unable to do so. Execute the command
Execute the
| |
| checkParameters | back to summary |
|---|---|
| private void checkParameters() throws InvalidMergeHeadsException | |
| fallBackToConfiguration | back to summary |
|---|---|
| private void fallBackToConfiguration() Use values from the configuration if they have not been explicitly defined via the setters | |
| include | back to summary |
|---|---|
| public MergeCommand include(Ref aCommit) Reference to a commit to be merged with the current head
| |
| include | back to summary |
|---|---|
| public MergeCommand include(AnyObjectId aCommit) Id of a commit which is to be merged with the current head
| |
| include | back to summary |
|---|---|
| public MergeCommand include(String name, AnyObjectId aCommit) Include a commit
| |
| setCommit | back to summary |
|---|---|
| public MergeCommand setCommit(boolean commit) Controls whether the merge command should automatically commit after a successful merge
| |
| setContentMergeStrategy | back to summary |
|---|---|
| public MergeCommand setContentMergeStrategy(ContentMergeStrategy strategy) Sets the content merge strategy to use if the
| |
| setFastForward | back to summary |
|---|---|
| public MergeCommand setFastForward(MergeCommand. Sets the fast forward mode.
| |
| setInsertChangeId | back to summary |
|---|---|
| public MergeCommand setInsertChangeId(boolean insertChangeId) If set to true a change id will be inserted into the commit message An existing change id is not replaced. An initial change id (I000...) will be replaced by the change id.
| |
| setMessage | back to summary |
|---|---|
| public MergeCommand setMessage(String message) Set the commit message to be used for the merge commit (in case one is created)
| |
| setProgressMonitor | back to summary |
|---|---|
| public MergeCommand setProgressMonitor(ProgressMonitor monitor) The progress monitor associated with the diff operation. By default, this
is set to
| |
| setSquash | back to summary |
|---|---|
| public MergeCommand setSquash(boolean squash) If
In case the merge was successful but this flag was set to
| |
| setStrategy | back to summary |
|---|---|
| public MergeCommand setStrategy(MergeStrategy mergeStrategy) Set merge strategy
| |
| updateHead | back to summary |
|---|---|
| private void updateHead(StringBuilder refLogMessage, ObjectId newHeadId, ObjectId oldHeadID) throws IOException, ConcurrentRefUpdateException | |
| Modifier and Type | Field and Description |
|---|---|
| public static final MergeCommand. | DIFF3
"diff3" style: ours/base/theirs. |
| public static final MergeCommand. | MERGE
"merge" style: only ours/theirs. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MergeCommand. | |
| public static MergeCommand. |
| DIFF3 | back to summary |
|---|---|
| public static final MergeCommand. "diff3" style: ours/base/theirs. | |
| MERGE | back to summary |
|---|---|
| public static final MergeCommand. "merge" style: only ours/theirs. This is the default. | |
| ConflictStyle | back to summary |
|---|---|
| private ConflictStyle() | |
| valueOf | back to summary |
|---|---|
| public static MergeCommand. | |
| values | back to summary |
|---|---|
| public static MergeCommand. | |
--ff, --no-ff and --ff-only
options under branch.<name>.mergeoptions.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | MergeCommand.
The modes available for fast forward merges corresponding to the
options under |
| Modifier and Type | Field and Description |
|---|---|
| public static final MergeCommand. | FF
Corresponds to the default --ff option (for a fast forward update the branch pointer only). |
| public static final MergeCommand. | FF_ONLY
Corresponds to the --ff-only option (abort unless the merge is a fast forward). |
| public static final MergeCommand. | NO_FF
Corresponds to the --no-ff option (create a merge commit even for a fast forward). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | matchConfigValue(String
the string to match in)Implements org. Checks if the given string matches with enum value. |
| public String | toConfigValue()
Implements org. Converts enumeration value into a string to be save in config. |
| public static MergeCommand. | |
| public static MergeCommand. | Returns: the mappedFastForwardMode valuethe ffModeFastForwardMode.Merge value to be mappedMap from |
| public static MergeCommand. |
| FF | back to summary |
|---|---|
| public static final MergeCommand. Corresponds to the default --ff option (for a fast forward update the branch pointer only). | |
| FF_ONLY | back to summary |
|---|---|
| public static final MergeCommand. Corresponds to the --ff-only option (abort unless the merge is a fast forward). | |
| NO_FF | back to summary |
|---|---|
| public static final MergeCommand. Corresponds to the --no-ff option (create a merge commit even for a fast forward). | |
| FastForwardMode | back to summary |
|---|---|
| private FastForwardMode() | |
| matchConfigValue | back to summary |
|---|---|
| public boolean matchConfigValue(String in) Implements org. Doc from org. Checks if the given string matches with enum value. | |
| toConfigValue | back to summary |
|---|---|
| public String toConfigValue() Implements org. Doc from org. Converts enumeration value into a string to be save in config. | |
| valueOf | back to summary |
|---|---|
| public static MergeCommand. | |
| valueOf | back to summary |
|---|---|
| public static MergeCommand. Map from
| |
| values | back to summary |
|---|---|
| public static MergeCommand. | |
merge.ff.
| Modifier and Type | Field and Description |
|---|---|
| public static final MergeCommand. | |
| public static final MergeCommand. | |
| public static final MergeCommand. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MergeCommand. | |
| public static MergeCommand. | Returns: the mappedFastForwardMode.Merge valuethe ffModeFastForwardMode value to be mappedMap from |
| public static MergeCommand. |
| FALSE | back to summary |
|---|---|
| public static final MergeCommand. | |
| ONLY | back to summary |
|---|---|
| public static final MergeCommand. | |
| TRUE | back to summary |
|---|---|
| public static final MergeCommand. | |
| Merge | back to summary |
|---|---|
| private Merge() | |
| valueOf | back to summary |
|---|---|
| public static MergeCommand. | |
| valueOf | back to summary |
|---|---|
| public static MergeCommand. Map from
| |
| values | back to summary |
|---|---|
| public static MergeCommand. | |