merge-recursive: more consistent interface
authorFelipe Gonçalves Assis <felipeg.assis@gmail.com>
Wed, 17 Feb 2016 03:15:26 +0000 (01:15 -0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Feb 2016 18:20:52 +0000 (10:20 -0800)
Add strategy option find-renames, following git-diff interface. This
makes the option rename-threshold redundant.

Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/merge-strategies.txt
merge-recursive.c
index 1a5e1974a559a685f3231ff29c926c799ebcc1bf..ff359b6ca23e4038fbe5b10bdf3aaf274f403264 100644 (file)
@@ -85,11 +85,13 @@ no-renames;;
        Turn off rename detection.
        See also linkgit:git-diff[1] `--no-renames`.
 
+find-renames[=<n>];;
+       Turn on rename detection, optionally setting the the similarity
+       threshold. This is the default.
+       See also linkgit:git-diff[1] `--find-renames`.
+
 rename-threshold=<n>;;
-       Controls the similarity threshold used for rename detection.
-       Re-enables rename detection if disabled by a preceding
-       `no-renames`.
-       See also linkgit:git-diff[1] `-M`.
+       Deprecated synonym for `find-renames=<n>`.
 
 subtree[=<path>];;
        This option is a more advanced form of 'subtree' strategy, where
index 6dd0a111f7f00a2efb477648d766044763f49da1..7bff5be164ef0c853818754d8e1882aac23ac6b1 100644 (file)
@@ -2094,7 +2094,10 @@ int parse_merge_opt(struct merge_options *o, const char *s)
                o->renormalize = 0;
        else if (!strcmp(s, "no-renames"))
                o->detect_rename = 0;
-       else if (skip_prefix(s, "rename-threshold=", &arg)) {
+       else if (!strcmp(s, "find-renames"))
+               o->detect_rename = 1;
+       else if (skip_prefix(s, "find-renames=", &arg) ||
+                skip_prefix(s, "rename-threshold=", &arg)) {
                if ((o->rename_score = parse_rename_score(&arg)) == -1 || *arg != 0)
                        return -1;
                o->detect_rename = 1;