Thread (9 messages) flat view 9 messages, 4 authors, 2016-06-15

Re: core.autocrlf considered half-assed

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:48:24

Hi,

On Sun, 7 Mar 2010, Dmitry Potapov wrote:
On Sat, Mar 06, 2010 at 12:23:33AM +0100, Johannes Schindelin wrote:
quoted
Just try to "git reset --hard" or "git stash" when there are files 
with DOS line endings and when core.autocrlf is not false.
I did, and I have not noticed any problem with that.

git init
git config core.autocrlf true
echo foo^ | tr ^ '\r' > foo
git add foo
git commit -m 'add foo'
Unfortunately, this is not the common case. The common case is that 
somebody committed _without_ autocrlf (implicitly =false), and you clone 
from there.

Easiest example:

$ git clone -n git://repo.or.cz/git.git html-docs
$ cd html-docs/
$ git config core.autocrlf true
$ git checkout -t origin/html
$ git status

... and despair.

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