Skip to content

Commit

Permalink
merge-recursive: more consistent interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Gonçalves Assis authored and Junio C Hamano committed Feb 17, 2016
1 parent d2b11ec commit 1b47ad1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Documentation/merge-strategies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b47ad1

Please sign in to comment.