Thread (58 messages) 58 messages, 11 authors, 2016-06-15

Re: [PATCH/RFC 0/3] Per-repository end-of-line normalization

flat view

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:48:46


On Fri, 7 May 2010, hasen j wrote:
On 7 May 2010 17:50, Linus Torvalds [off-list ref] wrote:
quoted
quoted
What if:

- The entire history of the file is stored in CRLF
- It's a windows-only file where the official "tool" that reads it
barfs on LF line endings.
- Third party tools also expect (or at least, handle) CRLF line endings.
Umm. Then it's not text, is it? What you are describing is a binary file
that happens to look like text with CRLF.
That depends on your definition of text.
Well, my definition of text is "does it make sense to do any end-of-line 
conversions". That's the only definition that makes sense for an SCM, at 
least in the current context. If doing conversions on the line endings is 
wrong, then it's not text.

And your whole premise was that conversions were always wrong. So the way 
you put it, that's not a text-file, it's a binary file.
Storing it with LF internally is ok, as long as we can have it
*always* be checked out as crlf.
.. and that's what I suggested "core.crlf=on" would mean.

However, if you think that it needs to be CRLF on _all_ platforms, even 
platforms where CRLF is _wrong_ for a text-file, then see above: in that 
case it's not a text-file at all as far as the SCM is concerned.

In that case it's just a binary file, and CRLF is _not_ "end of text 
line", it's part of the definition of the format for that binary file.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help