diff mbox series

[v2,1/1] doc add: renormalize is not idempotent for CRCRLF

Message ID 20220810144450.470-2-philipoakley@iee.email (mailing list archive)
State Accepted
Commit efae7ce6921d3ff9b3c6951d0da3efc9518027fc
Headers show
Series .. Add extra renormalize information. | expand

Commit Message

Philip Oakley Aug. 10, 2022, 2:44 p.m. UTC
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>
---
This is V2 of po/doc-add-renormalize, based on commit dc8c8deaa6
(Prepare for 2.36.2, 2022-06-07).
It was [PATCH 4/4] doc add: renormalize is not idempotent for CRCRLF.

git send-email \
    --in-reply-to=xmqq5yj6z5rx.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=philipoakley@iee.email \
    --cc=tboegi@web.de \
    v2-00*
---
 Documentation/git-add.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Torsten Bögershausen Aug. 10, 2022, 5:11 p.m. UTC | #1
[]

> diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
> index 11eb70f16c..9b37f35654 100644
> --- a/Documentation/git-add.txt
> +++ b/Documentation/git-add.txt
> @@ -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.

Thanks, I think this one looks good to me.
Reviewed-by: Torsten Bögershausen <tboegi@web.de>
Junio C Hamano Aug. 10, 2022, 5:42 p.m. UTC | #2
Philip Oakley <philipoakley@iee.email> writes:

> diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
> index 11eb70f16c..9b37f35654 100644
> --- a/Documentation/git-add.txt
> +++ b/Documentation/git-add.txt
> @@ -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.

Looks perfetly readable and understandable to me.

Thanks, will replace.  Let's plan to merge it down soonish.
diff mbox series

Patch

diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 11eb70f16c..9b37f35654 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -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