Re: mingw, windows, crlf/lf, and git
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 12, 2007, 23:02 UTC
- Message-ID
- <7vk5yn6ktl.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <7vps8f6l81.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 18 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes: > >> Btw, how would I implement this? If I really were energetic enough to >> implement it, I would do: >> ... >> (b) Teach the git-update-index logic about hashing text blobs. > > I agree that we can assume editors can grok files with LF > end-of-line just fine and we would not need to do the reverse > conversion on checkout paths (e.g. "read-tree -u", "checkout-index"). > > Textual diff generation needs to learn the CRLF-to-LF conversion > in diff_populate_filespec(); this needs to be done even when the > caller wants size_only. > > Oops. > > Not so fast. What's your plan for st_size?
If I were to do this, I would say the cache should store the size on the filesystem in stat fields. Which means that the object name recorded is text blob _after_ line endings are normalized to LF, and its exploded size does not necessarily match the cached size.
So this means that whoever does the diff_populate_filespec() change needs to be careful, but it is not such a big deal.