Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: [PATCH 2/2] Define a few built-in attribute rules.

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

Possibly related (same subject, not in this thread)


On Sat, 14 Apr 2007, Junio C Hamano wrote:
You do not have to worry.
I do.
That's how "crlf" is defined.  Paths you explicitly say !crlf
will _not_ go through the existing core.autocrlf mechanism.
That's broken.

It should be:

 - "crlf": always do crlf.
 - "!crlf": never do crlf.
 - no attrbute: guess.

Why? Because quite frankly, it's quite possible that some file really *is* 
text, even if the content-based guessing doesn't catch it. 

It boils down to a simple truth: if our content-based guessing is so 
perfect that it never makes mistakes, there's no *point* to having a 
'crlf' attribute in the first place!

Here's a simple example:

	echo -e '\007Bell!' > bell

and just because we consider the BEL character to be binary, we'll think 
the file is binary.

Could we add the BEL character? Sure. But that's not the point. The 
*point* is that the whole and only reason for attributes in the first 
place is to _override_ guessing.

The guesses should be good enough that hopefully nobody really will ever 
need attributes. But people do strange things.

			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