# Confusing note in "gitattributes text=auto" discription

2 messages from 2022-05-09 to 2022-05-09. Participants: Hebrock, Christoph, Torsten Bögershausen.
Thread: https://gitlist.dev/t/57863

## Hebrock, Christoph, 2022-05-09 10:59

Subject: Confusing note in "gitattributes text=auto" discription
Message-ID: <AM6PR03MB5444D37306312CE538C9BD1BCAC69@AM6PR03MB5444.eurprd03.prod.outlook.com>
URL: https://gitlist.dev/e/AM6PR03MB5444D37306312CE538C9BD1BCAC69%40AM6PR03MB5444.eurprd03.prod.outlook.com

```
Dear Sir or Madam,
I have a question about "gitattributes text".

I find the sentence "When the file has been committed with CRLF, no conversion is done" somewhat confusing in the context descibed above.
How is this possible when "text=auto" is active to commit/checkin CRLF?

Set to string value "auto"
When text is set to "auto", the path is marked for automatic end-of-line conversion. If Git decides that the content is text, its line endings are converted to LF on checkin. 
"When the file has been committed with CRLF, no conversion is done."


With kind regards
Christoph Hebrock

```

## Torsten Bögershausen, 2022-05-09 15:27

Subject: Re: Confusing note in "gitattributes text=auto" discription
Message-ID: <20220509152728.32kgmus6dht7uofn@tb-raspi4>
URL: https://gitlist.dev/e/20220509152728.32kgmus6dht7uofn%40tb-raspi4
In-Reply-To: <AM6PR03MB5444D37306312CE538C9BD1BCAC69@AM6PR03MB5444.eurprd03.prod.outlook.com>

```
On Mon, May 09, 2022 at 10:59:08AM +0000, Hebrock, Christoph wrote:
> Dear Sir or Madam,
> I have a question about "gitattributes text".
>
> I find the sentence "When the file has been committed with CRLF, no conversion is done" somewhat confusing in the context descibed above.
> How is this possible when "text=auto" is active to commit/checkin CRLF?
>
> Set to string value "auto"
> When text is set to "auto", the path is marked for automatic end-of-line conversion. If Git decides that the content is text, its line endings are converted to LF on checkin.
> "When the file has been committed with CRLF, no conversion is done."

This is what happens in real live, and what we try to describe:
#On a Windows box:
mkdir test_repo
cd test_repo
git init
git config core.autocrlf false
printf 'REM my first BAT file\r\n' >test.bat
printf 'REM exit' >>test.bat
git add test.bat
git commit -m "Add test.bat"

git ls-files --eol
# Something in this style:
i/crlf w/crlf attr/            test.bat

Now the file has been commited with CRLF.

Does this answer the question ?




```
