]> git.ipfire.org Git - thirdparty/git.git/commitdiff
doc: clarify documentation for rename/copy limits
authorElijah Newren <newren@gmail.com>
Thu, 15 Jul 2021 00:45:22 +0000 (00:45 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Jul 2021 23:54:24 +0000 (16:54 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/diff.txt
Documentation/config/merge.txt
Documentation/diff-options.txt

index 2d3331f55c2219425bd90942bca45f8edced5c4f..d1b5cfa354210883c55ca3fc43e10098f1d3a4a7 100644 (file)
@@ -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 currently 400.  This
+       setting has no effect if rename detection is turned off.
 
 diff.renames::
        Whether and how Git detects renames.  If set to "false",
index 6b66c83eabeea5309e07efb54eb450ffebf71d26..7cd6d7883b6cd0fa6139ce21201fb6e93c444c14 100644 (file)
@@ -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,
+       currently 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
index 32e6dee5ac3b6a7de96a9b2634664b5ed047202c..58acfff92893898f4656eaeeac04ae637c4971b2 100644 (file)
@@ -588,11 +588,16 @@ 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 number of rename/copy targets exceeds the specified
-       number.
+       The `-M` and `-C` options involve some preliminary steps that
+       can detect subsets of renames/copies cheaply, followed by an
+       exhaustive fallback portion that compares all remaining
+       unpaired destinations to all relevant sources.  (For renames,
+       only remaining unpaired sources are relevant; for copies, all
+       original sources are relevant.)  For N sources and
+       destinations, this exhaustive check is O(N^2).  This option
+       prevents the exhaustive portion of rename/copy detection from
+       running if the number of source/destination files involved
+       exceeds the specified number.  Defaults to diff.renameLimit.
 
 ifndef::git-format-patch[]
 --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::