merge-recursive: more consistent interface

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>

Felipe Gonçalves Assis committed Feb 17, 2016 at 01:15 UTC 1b47ad160b55f50a7a98c180e18d80f0f8f17a67
2 files changed +10 -5
Documentation/merge-strategies.txt
+6 -4
@@ -85,11 +85,13 @@ no-renames;;
85 Turn off rename detection.
86 See also linkgit:git-diff[1] `--no-renames`.
87
88 +find-renames[=<n>];;
89 + Turn on rename detection, optionally setting the the similarity
90 + threshold. This is the default.
91 + See also linkgit:git-diff[1] `--find-renames`.
92 +
93 rename-threshold=<n>;;
89 - Controls the similarity threshold used for rename detection.
90 - Re-enables rename detection if disabled by a preceding
91 - `no-renames`.
92 - See also linkgit:git-diff[1] `-M`.
94 + Deprecated synonym for `find-renames=<n>`.
95
96 subtree[=<path>];;
97 This option is a more advanced form of 'subtree' strategy, where
merge-recursive.c
+4 -1
@@ -2094,7 +2094,10 @@ int parse_merge_opt(struct merge_options *o, const char *s)
2094 o->renormalize = 0;
2095 else if (!strcmp(s, "no-renames"))
2096 o->detect_rename = 0;
2097 - else if (skip_prefix(s, "rename-threshold=", &arg)) {
2097 + else if (!strcmp(s, "find-renames"))
2098 + o->detect_rename = 1;
2099 + else if (skip_prefix(s, "find-renames=", &arg) ||
2100 + skip_prefix(s, "rename-threshold=", &arg)) {
2101 if ((o->rename_score = parse_rename_score(&arg)) == -1 || *arg != 0)
2102 return -1;
2103 o->detect_rename = 1;