From: Bertrand Jacquin Date: Sun, 04 Jun 2006 02:24:45 GMT Subject: Re: Importing Mozilla CVS into git Message-ID: <4fb292fa0606031924v42024765l9f068f6915bfcf96@mail.gmail.com> In-Reply-To: On 6/4/06, Linus Torvalds wrote: > > > On Sun, 4 Jun 2006, Robin Rosenberg (list subscriber) wrote: > > > > (Yet) Another problem is that many windows tools use CR LF as the line ending. > > Almost all windows editors default to CRLF and some detect existing line > > endings. No editing with notepad anymore. Of course that is a problem > > regardless of whether a git or cvs client is used. You'll get these big > > everything-changed commits that alter between CRLF and LF. > > The only sane approach there (if you want to be at all cross-platform) is > to just force everybody to _commit_ in UNIX '\n'-only format. Especially > as most Windows tools probably handle that fine on reading (just have > trouble writing them). > > And that shouldn't actually be that hard to do. The most trivial approach > is to have just a pre-trigger on commits, but let's face it, that would > not be a good "full" solution. A better one is to just make the whole > "git update-index" thing just have a "automatically ignore CR/LF" mode. > > Which really shouldn't be that hard. I think it's literally a matter of > teaching "index_fd()" in sha1_file.c to recognize text-files, and remove > CR/LF from them. All done (except to add the flag that enables the > detection, of course - just so that sane systems won't have the overhead > or the "corrupt binary files" issue). > > Something like this is TOTALLY UNTESTED! > > (You also need to teach "diff" to ignore differences in cr/lf, and this > patch is bad because it's unconditional, and probably doesn't work > anyway, but hey, the idea is possibly sound. Maybe) Is it also apply for binary files ? It could corrupt files as well. If end-user application don't understand '\n' but '\r\n', you can have bad issues (I think to notepad here (yes crappy, but ..)). Couldn't it be configurable ? -- # Beber : beber@gna.org # IM : beber@jabber.fr # http://guybrush.ath.cx, irc://irc.freenode.net/#{e.fr,gentoofr}