git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Confusing note in "gitattributes text=auto" discription
@ 2022-05-09 10:59 Hebrock, Christoph
  2022-05-09 15:27 ` Torsten Bögershausen
  0 siblings, 1 reply; 2+ messages in thread
From: Hebrock, Christoph @ 2022-05-09 10:59 UTC (permalink / raw)
  To: git@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Confusing note in "gitattributes text=auto" discription
  2022-05-09 10:59 Confusing note in "gitattributes text=auto" discription Hebrock, Christoph
@ 2022-05-09 15:27 ` Torsten Bögershausen
  0 siblings, 0 replies; 2+ messages in thread
From: Torsten Bögershausen @ 2022-05-09 15:27 UTC (permalink / raw)
  To: Hebrock, Christoph; +Cc: git@vger.kernel.org

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 ?




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-09 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 10:59 Confusing note in "gitattributes text=auto" discription Hebrock, Christoph
2022-05-09 15:27 ` Torsten Bögershausen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).