git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 2/2] merge-recursive: more consistent interface

From
FAFelipe Gonçalves Assis <felipeg.assis@gmail.com>
Date
Feb 17, 2016, 01:11 UTC
Message-ID
<1455671495-10908-3-git-send-email-felipegassis@gmail.com>
In-Reply-To
<1455671495-10908-1-git-send-email-felipegassis@gmail.com>

Add strategy option find-renames, following git-diff interface. This makes the option rename-threshold redundant. ---

A minor note git diff --check complains about an indent with spaces here, but I think I did the right thing: indented with tabs and aligned with spaces. If desired, I can align with tabs to avoid this.

 Documentation/merge-strategies.txt | 8 ++++++--
 merge-recursive.c                  | 5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt
index 1a5e197..f8618c9 100644
--- a/Documentation/merge-strategies.txt
+++ b/Documentation/merge-strategies.txt
@@ -85,11 +85,15 @@ no-renames;;
 	Turn off rename detection.
 	See also linkgit:git-diff[1] `--no-renames`.
 
-rename-threshold=<n>;;
+find-renames[=<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`.
+	See also linkgit:git-diff[1] `--find-renames`.
+
+rename-threshold=<n>;;
+	Synonym for `find-renames=<n>`. Present for historical reasons.
+	New scripts should prefer the `find-renames=<n>` syntax.
 
 subtree[=<path>];;
 	This option is a more advanced form of 'subtree' strategy, where
diff --git a/merge-recursive.c b/merge-recursive.c
index 6dd0a11..700febd 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -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;
-- 
2.7.1.288.gfad33a8
Previous: Felipe Gonçalves AssisNext: Eric Sunshine
Message 5 of 8 in “merge-recursive: option to disable renames”
  1. 0/2 merge-recursive: option to disable renamesFelipe Gonçalves Assis, Feb 17, 2016
  2. 1/2 merge-recursive: option to disable renamesFelipe Gonçalves Assis, Feb 17, 2016
  3. Eric SunshineFeb 17, 2016
  4. Felipe Gonçalves AssisFeb 17, 2016
  5. 2/2 merge-recursive: more consistent interfaceFelipe Gonçalves Assis, Feb 17, 2016
  6. Eric SunshineFeb 17, 2016
  7. Eric SunshineFeb 17, 2016
  8. Felipe Gonçalves AssisFeb 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.