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

[PATCH 2/3] bump rename limit defaults

From
Jeff King <peff@peff.net>
Date
Apr 30, 2008, 17:24 UTC
Message-ID
<20080430172443.GB23747@sigill.intra.peff.net>
In-Reply-To
<20080430172136.GA22601@sigill.intra.peff.net>

The current rename limit default of 100 was arbitrarily chosen. Testing[1] has shown that on modern hardware, a limit of 200 adds about a second of computation time, and a limit of 500 adds about 5 seconds of computation time.

This patch bumps the default limit to 200 for viewing diffs, and to 500 for performing a merge. The limit for generating git-status templates is set independently; we bump it up to 200 here, as well, to match the diff limit.

[1]: See <20080211113516.GB6344@coredump.intra.peff.net>
Signed-off-by: Jeff King <peff@peff.net>
---
 builtin-merge-recursive.c |    2 +-
 diff.c                    |    2 +-
 wt-status.c               |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c
index 1293e3d..3902e91 100644
--- a/builtin-merge-recursive.c
+++ b/builtin-merge-recursive.c
@@ -364,7 +364,7 @@ static struct path_list *get_renames(struct tree *tree,
 	opts.detect_rename = DIFF_DETECT_RENAME;
 	opts.rename_limit = merge_rename_limit >= 0 ? merge_rename_limit :
 			    diff_rename_limit >= 0 ? diff_rename_limit :
-			    100;
+			    500;
 	opts.output_format = DIFF_FORMAT_NO_OUTPUT;
 	if (diff_setup_done(&opts) < 0)
 		die("diff setup failed");
diff --git a/diff.c b/diff.c
index 3632b55..f735519 100644
--- a/diff.c
+++ b/diff.c
@@ -19,7 +19,7 @@
 #endif
 
 static int diff_detect_rename_default;
-static int diff_rename_limit_default = 100;
+static int diff_rename_limit_default = 200;
 int diff_use_color_default = -1;
 static const char *external_diff_cmd_cfg;
 int diff_auto_refresh_index = 1;
diff --git a/wt-status.c b/wt-status.c
index 532b4ea..a44c543 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -206,7 +206,7 @@ static void wt_status_print_updated(struct wt_status *s)
 	rev.diffopt.format_callback = wt_status_print_updated_cb;
 	rev.diffopt.format_callback_data = s;
 	rev.diffopt.detect_rename = 1;
-	rev.diffopt.rename_limit = 100;
+	rev.diffopt.rename_limit = 200;
 	rev.diffopt.break_opt = 0;
 	run_diff_index(&rev, 1);
 }
-- 
1.5.5.1.177.g8182d.dirty
Previous: Jeff KingNext: Jeff King
Message 10 of 22 in “warning: too many files, skipping inexact rename detection”
  1. Andrew MortonApr 26, 2008
  2. Jeff KingApr 26, 2008
  3. Andrew MortonApr 26, 2008
  4. Jeff KingApr 26, 2008
  5. 0/3 rename limit improvementsJeff King, Apr 30, 2008
  6. 1/3 add merge.renamelimit config optionJeff King, Apr 30, 2008
  7. Jeff KingApr 30, 2008
  8. Junio C HamanoMay 3, 2008
  9. Jeff KingMay 4, 2008
  10. 2/3 bump rename limit defaultsJeff King, Apr 30, 2008
  11. 3/3 diff: make "too many files" rename warning optionalJeff King, Apr 30, 2008
  12. Ramsay JonesMay 3, 2008
  13. Jeff KingMay 4, 2008
  14. Paul MackerrasMay 4, 2008
  15. Jeff KingMay 5, 2008
  16. Jeff KingMay 5, 2008
  17. Junio C HamanoMay 5, 2008
  18. Paul MackerrasMay 12, 2008
  19. Ramsay JonesMay 6, 2008
  20. Ramsay JonesMay 6, 2008
  21. Junio C HamanoMay 4, 2008
  22. Jeff KingMay 4, 2008

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.