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

[PATCH 1/5] merge-recursive: find-renames resets threshold

From
FAFelipe Gonçalves Assis <felipeg.assis@gmail.com>
Date
Feb 21, 2016, 15:09 UTC
Message-ID
<1456067358-19781-2-git-send-email-felipegassis@gmail.com>
In-Reply-To
<1456067358-19781-1-git-send-email-felipegassis@gmail.com>

Make the find-renames option follow the behaviour in git-diff, where it resets the threshold when none is given. So, for instance, "--find-renames=25 --find-renames" should result in the default threshold (50%) instead of 25%.

Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com>
---
 merge-recursive.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 7bff5be..b880ae5 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -2094,8 +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 (!strcmp(s, "find-renames"))
+	else if (!strcmp(s, "find-renames")) {
 		o->detect_rename = 1;
+		o->rename_score = 0;
+	}
 	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)
-- 
2.7.1.492.gc9722f8
Previous: Felipe Gonçalves AssisNext: Eric Sunshine
Message 2 of 16 in “Tests and fixes for merge-recursive rename options”
  1. 0/5 Tests and fixes for merge-recursive rename optionsFelipe Gonçalves Assis, Feb 21, 2016
  2. 1/5 merge-recursive: find-renames resets thresholdFelipe Gonçalves Assis, Feb 21, 2016
  3. Eric SunshineFeb 21, 2016
  4. 2/5 merge-strategies.txt: fix typoFelipe Gonçalves Assis, Feb 21, 2016
  5. Eric SunshineFeb 21, 2016
  6. 3/5 merge-recursive: test rename threshold optionFelipe Gonçalves Assis, Feb 21, 2016
  7. Eric SunshineFeb 21, 2016
  8. Felipe Gonçalves AssisFeb 21, 2016
  9. Eric SunshineFeb 21, 2016
  10. Junio C HamanoFeb 21, 2016
  11. 4/5 merge-recursive: test option to disable renamesFelipe Gonçalves Assis, Feb 21, 2016
  12. Eric SunshineFeb 21, 2016
  13. 5/5 merge-recursive: test more consistent interfaceFelipe Gonçalves Assis, Feb 21, 2016
  14. Eric SunshineFeb 21, 2016
  15. Felipe Gonçalves AssisFeb 21, 2016
  16. Eric SunshineFeb 21, 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.