Thread (6 messages) flat view 6 messages, 5 authors, 2016-06-15

Re: mingw, windows, crlf/lf, and git

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


On Mon, 12 Feb 2007, Junio C Hamano wrote:
Not so fast.  What's your plan for st_size?
Umm. There's two (very distinct) uses for st_size.

The one that we actually use to validate the current index obviously must 
match the "OS returned value". It contains all the CR/LF stuff.

The one where we actually read the file and run SHA1 on the result must 
obviously be the post-conversion one.

But it shouldn't be a problem. We'll always know which one matters: the 
index case is always about pure stat information (and has no meaning 
outside of that, really - after all, it's no different from st_mode etc, 
and we actually keep it in a special binary format that is endian-safe!) 
and the "real object" case is always about the *data* we use to compare 
with.

I don't think we ever mix the two anyway.

		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