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

[PATCH v2 2/4] doc: clarify documentation for rename/copy limits

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 14, 2021, 01:12 UTC
Message-ID
<4046993a9a2af79029c1ce94d20616831e94d786.1626225154.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1044.v2.git.git.1626225153.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>

A few places in the docs implied that rename/copy detection is always quadratic or that all (unpaired) files were involved in the quadratic portion of rename/copy detection. The following two commits each introduced an exception to this:

    9027f53cb505 (Do linear-time/space rename logic for exact renames,
                  2007-10-25)
    bd24aa2f97a0 (diffcore-rename: guide inexact rename detection based
                  on basenames, 2021-02-14)

(As a side note, for copy detection, the basename guided inexact rename detection is turned off and the exact renames will only result in sources (without the dests) being removed from the set of files used in quadratic detection. So, for copy detection, the documentation was closer to correct.)

Avoid implying that all files involved in rename/copy detection are subject to the full quadratic algorithm. While at it, also note the default values for all these settings.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 Documentation/config/diff.txt  |  7 ++++---
 Documentation/config/merge.txt | 10 ++++++----
 Documentation/diff-options.txt |  9 +++++----
 3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/Documentation/config/diff.txt b/Documentation/config/diff.txt
index 2d3331f55c2..e26a63d0d42 100644
--- a/Documentation/config/diff.txt
+++ b/Documentation/config/diff.txt
@@ -118,9 +118,10 @@ diff.orderFile::
 	relative to the top of the working tree.
 
 diff.renameLimit::
-	The number of files to consider when performing the copy/rename
-	detection; equivalent to the 'git diff' option `-l`. This setting
-	has no effect if rename detection is turned off.
+	The number of files to consider in the exhaustive portion of
+	copy/rename detection; equivalent to the 'git diff' option
+	`-l`.  If not set, the default value is 400.  This setting has
+	no effect if rename detection is turned off.
 
 diff.renames::
 	Whether and how Git detects renames.  If set to "false",
diff --git a/Documentation/config/merge.txt b/Documentation/config/merge.txt
index 6b66c83eabe..aca0c92dbe6 100644
--- a/Documentation/config/merge.txt
+++ b/Documentation/config/merge.txt
@@ -33,10 +33,12 @@ merge.verifySignatures::
 include::fmt-merge-msg.txt[]
 
 merge.renameLimit::
-	The number of files to consider when performing rename detection
-	during a merge; if not specified, defaults to the value of
-	diff.renameLimit. This setting has no effect if rename detection
-	is turned off.
+	The number of files to consider in the exhaustive portion of
+	rename detection during a merge.  If not specified, defaults
+	to the value of diff.renameLimit.  If neither
+	merge.renameLimit nor diff.renameLimit are specified, defaults
+	to 1000.  This setting has no effect if rename detection is
+	turned off.
 
 merge.renames::
 	Whether Git detects renames.  If set to "false", rename detection
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 32e6dee5ac3..11e08c3fd36 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -588,11 +588,12 @@ When used together with `-B`, omit also the preimage in the deletion part
 of a delete/create pair.
 
 -l<num>::
-	The `-M` and `-C` options require O(n^2) processing time where n
-	is the number of potential rename/copy targets.  This
-	option prevents rename/copy detection from running if
+	The `-M` and `-C` options have an exhaustive portion that
+	requires O(n^2) processing time where n is the number of
+	potential rename/copy targets.  This option prevents the
+	exhaustive portion of rename/copy detection from running if
 	the number of rename/copy targets exceeds the specified
-	number.
+	number.  Defaults to diff.renameLimit.
 
 ifndef::git-format-patch[]
 --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::
-- 
gitgitgadget
Previous: Elijah Newren via GitGitGadgetNext: Ævar Arnfjörð Bjarmason
Message 21 of 44 in “Improve the documentation and warnings dealing with rename/copy limits”
  1. 0/3 Improve the documentation and warnings dealing with rename/copy limitsElijah Newren via GitGitGadget, Jul 11, 2021
  2. 2/3 doc: document the special handling of -l0Elijah Newren via GitGitGadget, Jul 11, 2021
  3. Eric SunshineJul 11, 2021
  4. Elijah NewrenJul 11, 2021
  5. 1/3 doc: clarify documentation for rename/copy limitsElijah Newren via GitGitGadget, Jul 11, 2021
  6. Bagas SanjayaJul 11, 2021
  7. Elijah NewrenJul 11, 2021
  8. Derrick StoleeJul 12, 2021
  9. Junio C HamanoJul 12, 2021
  10. 3/3 diff: correct warning message when renameLimit exceededElijah Newren via GitGitGadget, Jul 11, 2021
  11. Derrick StoleeJul 12, 2021
  12. Elijah NewrenJul 12, 2021
  13. Junio C HamanoJul 14, 2021
  14. Elijah NewrenJul 14, 2021
  15. Junio C HamanoJul 14, 2021
  16. Elijah NewrenJul 14, 2021
  17. Junio C HamanoJul 14, 2021
  18. Elijah NewrenJul 14, 2021
  19. 0/4 Rename/copy limits -- docs, warnings, and new defaultsElijah Newren via GitGitGadget, Jul 14, 2021
  20. 1/4 diff: correct warning message when renameLimit exceededElijah Newren via GitGitGadget, Jul 14, 2021
  21. 2/4 doc: clarify documentation for rename/copy limitsElijah Newren via GitGitGadget, Jul 14, 2021
  22. Ævar Arnfjörð BjarmasonJul 14, 2021
  23. Elijah NewrenJul 14, 2021
  24. Ævar Arnfjörð BjarmasonJul 14, 2021
  25. Elijah NewrenJul 14, 2021
  26. 3/4 doc: document the special handling of -l0Elijah Newren via GitGitGadget, Jul 14, 2021
  27. Jeff KingJul 14, 2021
  28. Elijah NewrenJul 14, 2021
  29. Jeff KingJul 14, 2021
  30. Elijah NewrenJul 14, 2021
  31. 4/4 Bump rename limit defaults (yet again)Elijah Newren via GitGitGadget, Jul 14, 2021
  32. Jeff KingJul 14, 2021
  33. Elijah NewrenJul 14, 2021
  34. Jeff KingJul 14, 2021
  35. Elijah NewrenJul 14, 2021
  36. Jeff KingJul 14, 2021
  37. 0/4 Rename/copy limits -- docs, warnings, and new defaultsElijah Newren via GitGitGadget, Jul 15, 2021
  38. 1/4 diff: correct warning message when renameLimit exceededElijah Newren via GitGitGadget, Jul 15, 2021
  39. 2/4 doc: clarify documentation for rename/copy limitsElijah Newren via GitGitGadget, Jul 15, 2021
  40. 3/4 diffcore-rename: treat a rename_limit of 0 as unlimitedElijah Newren via GitGitGadget, Jul 15, 2021
  41. Junio C HamanoJul 15, 2021
  42. 4/4 Bump rename limit defaults (yet again)Elijah Newren via GitGitGadget, Jul 15, 2021
  43. Derrick StoleeJul 15, 2021
  44. Junio C HamanoJul 15, 2021

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.