Re: CRLF problems with Git on Win32

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

 




On Tue, 8 Jan 2008, Dmitry Potapov wrote:
> 
> Perhaps, this option can be called core.autocrlf=safe

We already do half of that:

        if (action == CRLF_GUESS) {
                /*
                 * We're currently not going to even try to convert stuff
                 * that has bare CR characters. Does anybody do that crazy
                 * stuff?
                 */
                if (stats.cr != stats.crlf)
                        return 0;

but we don't check that there are no "naked" LF characters.

So the only thing you'd need to add is to add a

		/* No naked LF's! */
		if (safecrlf && stats.lf)
			return 0;

to that sequence too, but the thing is, having mixed line-endings isn't 
actually all that unusual, so I think that kind of "autocrlf=safe" thing 
is actually almost useless - because when that thing triggers, you almost 
always *do* want to convert it to be just one way.

I've seen it multiple times when people cooperate with windows files with 
unix tools, where unix editors often preserve old CRLF's, but write new 
lines with just LF.

So "autocrlf=safe" would be trivial to add, but I suspect it would cause 
more confusion than it would fix.

		Linus
-
To unsubscribe from this list: 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]

  Powered by Linux