Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New parameter for additionalMergeOptions #157

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support different merge-options on hotfix-finish for merging into pro…
…duction-branch and dev-branch
  • Loading branch information
Martin Drößler committed Mar 25, 2019
commit 757357353f4c5091ec9a39bd0f791b7a451f8125
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,24 @@ protected void gitMerge(final String branchName, boolean rebase, boolean noff, b
*/
protected void gitMergeNoff(final String branchName)
throws MojoFailureException, CommandLineException {
gitMerge(branchName, false, true, false, null, null);
gitMergeNoff(branchName, additionalMergeOptions);
}

/**
* Executes git merge --no-ff.
*
* @param branchName
* Branch name to merge.
*
* @param additionalMergeOptions
* additional commandline options for the merge e.g. "-Xtheirs"
*
* @throws MojoFailureException
* @throws CommandLineException
*/
protected void gitMergeNoff(final String branchName, final String additionalMergeOptions)
throws MojoFailureException, CommandLineException {
gitMerge(branchName, false, true, false, null, null, additionalMergeOptions);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ public class GitFlowHotfixFinishMojo extends AbstractGitFlowMojo {
@Parameter(property = "skipMergeDevBranch", defaultValue = "false")
private boolean skipMergeDevBranch = false;

@Parameter(property = "productionBranchMergeOptions")
private String productionBranchMergeOptions;

@Parameter(property = "devBranchMergeOptions")
private String devBranchMergeOptions;

/** {@inheritDoc} */
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
Expand Down Expand Up @@ -199,7 +205,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}

// git merge --no-ff hotfix/...
gitMergeNoff(hotfixBranchName);
gitMergeNoff(hotfixBranchName, productionBranchMergeOptions);

final String currentVersion = getCurrentProjectVersion();

Expand Down Expand Up @@ -243,7 +249,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}

// git merge --no-ff hotfix/...
gitMergeNoff(hotfixBranchName);
gitMergeNoff(hotfixBranchName, devBranchMergeOptions);

if (!currentVersion.equals(releaseBranchVersion)) {
mvnSetVersions(releaseBranchVersion);
Expand All @@ -263,7 +269,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
gitCommit(commitMessages.getHotfixVersionUpdateMessage());

// git merge --no-ff hotfix/...
gitMergeNoff(hotfixBranchName);
gitMergeNoff(hotfixBranchName, devBranchMergeOptions);

// which version to increment
GitFlowVersionInfo hotfixVersionInfo = new GitFlowVersionInfo(
Expand Down