summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorAxel Richard <axel.richard@obeo.fr>2014-08-29 14:37:09 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2014-08-30 01:17:24 +0200
commit46f3007b52a5d12c5a973957128ac38680b20ab8 (patch)
treec51edac33977b1885f310945a6bba8e8220abdea /org.eclipse.jgit.pgm
parent7b7d033ee1fdd8e81ae2ad7dc9e1ae12cbd9ddfa (diff)
downloadjgit-46f3007b52a5d12c5a973957128ac38680b20ab8.tar.gz
jgit-46f3007b52a5d12c5a973957128ac38680b20ab8.zip
Handle -m option for Merge command
Set the commit message to be used for the merge commit (in case one is created) Bug: 442886 Change-Id: Ie5ecc13822faa366f00b3daa07f74c8441cae195 Signed-off-by: Axel Richard <axel.richard@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java9
2 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
index d801456198..574981d385 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
@@ -298,6 +298,7 @@ usage_mergeNoFf=Create a merge commit even when the merge resolves as a fast-for
usage_mergeFfOnly=Refuse to merge and exit with a non-zero status unless the current HEAD is already up-to-date or the merge can be resolved as a fast-forward.
usage_mergeRef=Ref to be merged
usage_mergeStrategy=Use the given merge strategy. Can be supplied more than once to specify them in the order they should be tried. If there is no -s option, the recursive strategy is used. Currently the following strategies are supported: ours, theirs, simple-two-way-in-core, resolve, recursive
+usage_message=Set the commit message to be used for the merge commit (in case one is created).
usage_moveRenameABranch=move/rename a branch
usage_nameStatus=show only name and status of files
usage_noCheckoutAfterClone=no checkout of HEAD is performed after the clone is complete
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java
index b3ff527ebc..93c4388dbc 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, Christian Halstrick <christian.halstrick@sap.com>
+ * Copyright (C) 2011, 2014 Christian Halstrick <christian.halstrick@sap.com>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -98,6 +98,9 @@ class Merge extends TextBuiltin {
ff = FastForwardMode.FF_ONLY;
}
+ @Option(name = "-m", usage = "usage_message")
+ private String message;
+
@Override
protected void run() throws Exception {
if (squash && ff == FastForwardMode.NO_FF)
@@ -125,6 +128,10 @@ class Merge extends TextBuiltin {
mergeCmd.include(srcRef);
else
mergeCmd.include(src);
+
+ if (message != null)
+ mergeCmd.setMessage(message);
+
MergeResult result;
try {
result = mergeCmd.call();