Re: Importing Mozilla CVS into git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/4/06, Linus Torvalds <torvalds@xxxxxxxx> 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@xxxxxxx
# IM : beber@xxxxxxxxx
# http://guybrush.ath.cx, irc://irc.freenode.net/#{e.fr,gentoofr}
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]