]> git.ipfire.org Git - thirdparty/git.git/commitdiff
doc: clarify the intent of the renormalize option in the merge machinery
authorElijah Newren <newren@gmail.com>
Tue, 11 Feb 2025 21:01:52 +0000 (21:01 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Feb 2025 21:34:36 +0000 (13:34 -0800)
The -X renormalize (or merge.renormalize config) option is intended to
reduce conflicts due to normalization of newer versions of history.  It
does so by renormalizing files that it is about to do a three-way
content merge on.  Some folks thought it would renormalize all files
throughout the tree, and the previous wording wasn't clear enough to
dispell that misconception.  Update the docs to make it clear that the
merge machinery will only apply renormalization to files which need a
three-way content merge.

(Technically, the merge machinery also does renormalization on
modify/delete conflicts, in order to see if the modification was merely
a normalization; if so, it can accept the delete and not report a
conflict.  But it's not clear that this piece needs to be explained to
users, and trying to distinguish it might feel like splitting hairs and
overcomplicating the explanation, so we leave it out.)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/merge.txt
Documentation/gitattributes.txt
Documentation/merge-strategies.txt

index 8851b6cedef980c106b9e86541862b517aa1f2ad..5806c1eb46d08a9c6988cfacb9e77a4d48ac5754 100644 (file)
@@ -69,7 +69,8 @@ merge.renormalize::
        Tell Git that canonical representation of files in the
        repository has changed over time (e.g. earlier commits record
        text files with CRLF line endings, but recent ones use LF line
-       endings).  In such a repository, Git can convert the data
+       endings).  In such a repository, for each file where a
+       three-way content merge is needed, Git can convert the data
        recorded in commits to a canonical form before performing a
        merge to reduce unnecessary conflicts.  For more information,
        see section "Merging branches with differing checkin/checkout
index e6150595af8210c1abc871b73cc78cbdfdeaeee7..9ae8117300301f195a56f6d8be5fd745319b5d93 100644 (file)
@@ -701,8 +701,8 @@ where the attribute is not in place would normally cause merge
 conflicts.
 
 To prevent these unnecessary merge conflicts, Git can be told to run a
-virtual check-out and check-in of all three stages of a file when
-resolving a three-way merge by setting the `merge.renormalize`
+virtual check-out and check-in of all three stages of each file that
+needs a three-way content merge, by setting the `merge.renormalize`
 configuration variable.  This prevents changes caused by check-in
 conversion from causing spurious merge conflicts when a converted file
 is merged with an unconverted file.
index 5fc54ec060b9638e11c66231eed6304de1772313..a5dc95a37838f56caa325681b2c80de64d67924a 100644 (file)
@@ -56,7 +56,7 @@ ignore-cr-at-eol;;
 
 renormalize;;
        This runs a virtual check-out and check-in of all three stages
-       of a file when resolving a three-way merge.  This option is
+       of any file which needs a three-way merge.  This option is
        meant to be used when merging branches with different clean
        filters or end-of-line normalization rules.  See "Merging
        branches with differing checkin/checkout attributes" in