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

[RFC/PATCH] rename: warn user when we have turned off rename detection

From
Jeff King <peff@peff.net>
Date
Mar 1, 2008, 06:14 UTC
Message-ID
<20080301061431.GA27301@coredump.intra.peff.net>
Signed-off-by: Jeff King <peff@peff.net>
---
This was another patch from late in the freeze period. It was in
response to a user getting confused about why rename detection wasn't
happening in a large merge. Is it appropriate to print this for every
rename we try? Or should it just be for merges?

Perhaps we should also bump the default limit from 100, which I think was just arbitrarily chosen. I posted some numbers in:

  http://mid.gmane.org/20080211113516.GB6344@coredump.intra.peff.net
which imply that 200-400 is probably a more reasonable value. Thoughts?
 diffcore-rename.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 3d37725..31941bc 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -468,10 +468,11 @@ void diffcore_rename(struct diff_options *options)
 	 */
 	if (rename_limit <= 0 || rename_limit > 32767)
 		rename_limit = 32767;
-	if (num_create > rename_limit && num_src > rename_limit)
-		goto cleanup;
-	if (num_create * num_src > rename_limit * rename_limit)
+	if ((num_create > rename_limit && num_src > rename_limit) ||
+	    (num_create * num_src > rename_limit * rename_limit)) {
+		warning("too many files, skipping inexact rename detection");
 		goto cleanup;
+	}
 
 	mx = xmalloc(sizeof(*mx) * num_create * num_src);
 	for (dst_cnt = i = 0; i < rename_dst_nr; i++) {
-- 
1.5.4.3.422.g55194
Next: Junio C Hamano
Message 1 of 4 in “rename: warn user when we have turned off rename detection”
  1. rename: warn user when we have turned off rename detectionJeff King, Mar 1, 2008
  2. Junio C HamanoMar 1, 2008
  3. Jeff KingMar 1, 2008
  4. Junio C HamanoMar 1, 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.