{"thread":{"id":"10006","subject":"[PATCH] Make merge-recursive honor diff.renamelimit","startedAt":"2007-09-25T06:36:38Z","lastAt":"2007-09-25T06:36:38Z","messageCount":1,"participants":["Lars Hjemli"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"53966","messageId":"1190702198133-git-send-email-hjemli@gmail.com","threadId":"10006","inReplyTo":null,"subject":"[PATCH] Make merge-recursive honor diff.renamelimit","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-09-25T06:36:38Z","receivedAt":"2007-09-25T06:36:38Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"It might be a sign of source code management gone bad, but when two branches\nhas diverged almost beyond recognition and time has come for the branches to\nmerge, the user is going to need all the help his tool can give him. Honoring\ndiff.renamelimit has great potential as a painkiller in such situations.\n\nThe painkiller effect could have been achieved by e.g. 'merge.renamelimit',\nbut the flexibility gained by a separate option is questionable: our user\nwould probably expect git to detect renames equally good when merging as\nwhen diffing (I known I did).\n\nSigned-off-by: Lars Hjemli <hjemli@gmail.com>\n---\n\n\nOn 9/14/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n> \n> The choice of default value is of course very debatable. Limiting the\n> rename matrix to a 100x100 size will mean that even if you have just one\n> obvious rename, but you also create (or delete) 10,000 files, the rename\n> matrix will be so big that we disable the heuristics. Sounds reasonable to\n> me, but let's see if people hit this (and, perhaps more importantly,\n> actually *care*) in real life.\n\nYeah, I got hit, and I care ;-)\n\n\n merge-recursive.c |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 19d5f3b..97dcf9b 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -96,6 +96,7 @@ static struct path_list current_directory_set = {NULL, 0, 0, 1};\n \n static int call_depth = 0;\n static int verbosity = 2;\n+static int rename_limit = -1;\n static int buffer_output = 1;\n static struct output_buffer *output_list, *output_end;\n \n@@ -372,6 +373,7 @@ static struct path_list *get_renames(struct tree *tree,\n \tdiff_setup(&opts);\n \topts.recursive = 1;\n \topts.detect_rename = DIFF_DETECT_RENAME;\n+\topts.rename_limit = rename_limit;\n \topts.output_format = DIFF_FORMAT_NO_OUTPUT;\n \tif (diff_setup_done(&opts) < 0)\n \t\tdie(\"diff setup failed\");\n@@ -1693,6 +1695,10 @@ static int merge_config(const char *var, const char *value)\n \t\tverbosity = git_config_int(var, value);\n \t\treturn 0;\n \t}\n+\tif (!strcasecmp(var, \"diff.renamelimit\")) {\n+\t\trename_limit = git_config_int(var, value);\n+\t\treturn 0;\n+\t}\n \treturn git_default_config(var, value);\n }\n \n-- \n1.5.3.2.1054.g35b0b\n"}]}