]> git.ipfire.org Git - thirdparty/git.git/commitdiff
doc add: renormalize is not idempotent for CRCRLF
authorPhilip Oakley <philipoakley@iee.email>
Wed, 10 Aug 2022 14:44:50 +0000 (15:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Aug 2022 18:26:38 +0000 (11:26 -0700)
Bug report
 https://lore.kernel.org/git/AM0PR02MB56357CC96B702244F3271014E8DC9@AM0PR02MB5635.eurprd02.prod.outlook.com/
noted that a file containing /r/r/n needed renormalising twice.

This is by design. Lone CR characters, not paired with an LF, are left
unchanged. Note this limitation of the "clean" filter in the documentation.

Renormalize was introduced at 9472935d81e (add: introduce "--renormalize",
Torsten Bögershausen, 2017-11-16)

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Reviewed-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-add.txt

index 11eb70f16c7287d53b567368754a19f33d4c7fb2..9b37f356542d1d8787f0344abf3243996fb89476 100644 (file)
@@ -188,7 +188,9 @@ for "git add --no-all <pathspec>...", i.e. ignored removed files.
        forcibly add them again to the index.  This is useful after
        changing `core.autocrlf` configuration or the `text` attribute
        in order to correct files added with wrong CRLF/LF line endings.
-       This option implies `-u`.
+       This option implies `-u`. Lone CR characters are untouched, thus
+       while a CRLF cleans to LF, a CRCRLF sequence is only partially
+       cleaned to CRLF.
 
 --chmod=(+|-)x::
        Override the executable bit of the added files.  The executable