From: Dmitry Potapov <dpotapov@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com, torvalds@linux-foundation.org
Subject: Re: core.autocrlf considered half-assed
Date: Sun, 7 Mar 2010 12:27:01 +0300 [thread overview]
Message-ID: <20100307092701.GC31105@dpotapov.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.1003060018170.20986@pacific.mpi-cbg.de>
On Sat, Mar 06, 2010 at 12:23:33AM +0100, Johannes Schindelin wrote:
>
> back then, I was not a fan of the core.autocrlf support. But I have to
> admit that in the meantime, I turned into an outright un-fan of the
> feature. Not because its intent is wrong, but because its implementation
> is lousy.
Well, I agree there are some issues with it. In particularly, when
someone changes core.autocrlf in his/her repository, and then git
behavior is outright confusing. IMHO, the nuts of the problem is that
does not store in the index how files were checkout. Instead it uses
core.autocrlf, which specifies how the user _wants_ files to be check-
out. So, when the autocrlf option changes, things get very confusing.
However:
> 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'
echo more^ | tr ^ '\r' >> foo
echo "Before reset:"
tr '\r' ^ < foo
git reset --hard
echo "After reset:"
git diff
tr '\r' ^ < foo
Dmitry
next prev parent reply other threads:[~2010-03-07 9:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 23:23 core.autocrlf considered half-assed Johannes Schindelin
2010-03-07 9:27 ` Dmitry Potapov [this message]
2010-03-07 23:45 ` Linus Torvalds
2010-03-08 18:57 ` Tait
2010-03-08 19:15 ` Johannes Schindelin
2010-03-08 20:31 ` Junio C Hamano
2010-03-09 9:28 ` Johannes Schindelin
2010-03-09 17:11 ` Junio C Hamano
2010-03-08 11:29 ` Johannes Schindelin
2010-03-09 7:24 ` Dmitry Potapov
2010-03-09 9:29 ` Johannes Schindelin
2010-03-09 10:11 ` Dmitry Potapov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100307092701.GC31105@dpotapov.dyndns.org \
--to=dpotapov@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).