Re: mingw, windows, crlf/lf, and git
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:54
Junio C Hamano [off-list ref] writes:
Linus Torvalds [off-list ref] writes:quoted
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.