Thread (27 messages) flat view 27 messages, 10 authors, 2016-08-13

Re: CRLF problems with Git on Win32

From: Rogan Dawes <hidden>
Date: 2016-06-15 22:44:04

Possibly related (same subject, not in this thread)

Gregory Jefferis wrote:
I'm not sure that I understand the whole deal about platform default line
endings.  Isn't plain git functionally agnostic about line endings?  You can
check in CRLF text files to git and it doesn't care.  You can diff, show etc
just fine.  I haven't yet found anything that breaks with CRLF files.  In
this sense plain git is already Windows ready.  Maybe I'm missing something?

Doesn't the problem only come if you try to diff a CRLF file with a new
version that has LF only line endings?  Then right now you have to use
something like:

    git diff --ignore-space-at-eol
In conclusion all of these CRLF options are designed to help Windows users
play nicely with others.  But it seems to me naïve Windows users can be
perfectly happy with plain git so long as they stay in their own Windows
world.

jm2c, corrections welcome and apologies to those suffering from eol
exhaustion,

Greg.

One example that bit me recently was "git-apply --whitespace=strip"

I have files with CRLF in my repo, but git was stripping the CR from 
lines that I applied via a patch.

I worked around it with a smudge/clean filter of "dos2unix | unix2dos" 
(first removes all CR's, second puts one back on each line)

Rogan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help