From: Pete B. <pb...@gm...> - 2010-12-04 12:49:55
|
Maybe I'm missing something, but I fail to see how applying -crlf (or -text) on the files we care about is not exactly the solution that we've been wanting all along. [1] "Unsetting the text attribute on a path tells git not to attempt any end-of-line conversion upon checkin or checkout. " In other words: "Move over git! I'll take care of line endings myself. And please make sure you don't touch them.", which seems to me like the exact solution we want. All we need to do is ensure the files we care about have the right line endings, and it won't matter who retreives files on which OS and with which tools. A .dsw retreived on any platform will have CRLF (provided it was checked in with CRLF, which should be the case if .gitattributes applied at the time of checking in) and a .sh will have LF. So UNIX people can package files for MS users, and life's just peachy. The only issue is if the same file *must* be CRLF in one environment and LF in another, but we have no such item. Our .sh/.am/.ac must be LF in all environments, and our .dsw/.dsp/.vcproj/.sln must (should?) be CRLF, so using -crlf on those sounds like the perfectly logical approach. Even Segher's statement that "git expects plain LF for line-endings in the checked in repo, for things like its built-in diff, etc." doesn't seem to be a big deal from my experience, as git will just see "\r" as an extra character at the end of the line (see [2] for an example), which is absolutely fine. As to not using tools that can handle a specific set of line terminators, I don't think that is something we should concern ourselves with, so long as users always get the files that matter with line endings that are set in stone. Michael, what happens if you clone my directory from scratch? Given the current .gitattributes [3] (I have a commit that adds *.am/*.ac that I haven't pushed in yet) and the fact that I made sure that the .sh's were LF'd and the MS projects files were CRLF'd, if you don't get the expected line terminators, then either something doesn't work about -crlf (or it can be overridden locally) or I something is wrong in my understanding of what -crlf/-text is all about. Regards, /Pete [1] http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html [2] http://git.libusb.org/?p=libusb-pbatard.git;a=commitdiff;h=02043e6e0e2f27fe1d4f2a43ad7c42d6cd8b04a3;js=1 [3] http://git.libusb.org/?p=libusb-pbatard.git;a=blob;f=.gitattributes |