summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java18
2 files changed, 19 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
index b803604dc1..488cff0b9b 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
@@ -147,6 +147,7 @@ usage_configureTheServiceInDaemonServicename=configure the service in daemon.ser
usage_deleteBranchEvenIfNotMerged=delete branch (even if not merged)
usage_deleteFullyMergedBranch=delete fully merged branch
usage_detectRenames=detect renamed files
+usage_diffAlgorithm=the diff algorithm to use
usage_directoriesToExport=directories to export
usage_disableTheServiceInAllRepositories=disable the service in all repositories
usage_displayAListOfAllRegisteredJgitCommands=Display a list of all registered jgit commands
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
index a5f801b296..19d11d629e 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
@@ -53,8 +53,11 @@ import java.io.PrintWriter;
import java.text.MessageFormat;
import java.util.List;
+import org.eclipse.jgit.diff.DiffAlgorithm;
import org.eclipse.jgit.diff.DiffEntry;
import org.eclipse.jgit.diff.DiffFormatter;
+import org.eclipse.jgit.diff.HistogramDiff;
+import org.eclipse.jgit.diff.MyersDiff;
import org.eclipse.jgit.diff.RawTextComparator;
import org.eclipse.jgit.diff.RenameDetector;
import org.eclipse.jgit.dircache.DirCacheIterator;
@@ -98,6 +101,21 @@ class Diff extends TextBuiltin {
detectRenames = Boolean.FALSE;
}
+ enum SupportedAlgorithm {
+ myers(MyersDiff.INSTANCE), histogram(new HistogramDiff());
+
+ public DiffAlgorithm algorithm;
+
+ SupportedAlgorithm(DiffAlgorithm a) {
+ algorithm = a;
+ }
+ };
+
+ @Option(name = "--algorithm", usage = "usage_diffAlgorithm")
+ void setAlgorithm(SupportedAlgorithm s) {
+ diffFmt.setDiffAlgorithm(s.algorithm);
+ }
+
@Option(name = "-l", usage = "usage_renameLimit")
private Integer renameLimit;