Git development
 help / color / mirror / Atom feed
From: Hannu Koivisto <azure@iki.fi>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Re: CRLF support bugs
Date: Mon, 03 Nov 2008 17:25:18 +0200	[thread overview]
Message-ID: <83skq8al29.fsf@kalahari.s2.org> (raw)
In-Reply-To: 83y700alzf.fsf_-_@kalahari.s2.org

Hannu Koivisto <azure@iki.fi> writes:

> Actually, even if .gitattributes were applied in checkout, I think
> the whole CRLF support is broken by design because people will have
> to remember to use -n in clone, then enable core.autocrlf support
> and then checkout.  This makes it unneccessarily complicated to

I forgot one thing: so what if someone forgets to use -n or just
imagines that you can set core.autocrlf afterwards?

# Pretend someone does this on Unix
mkdir test1
cd test1
git init
echo "*.c crlf" > .gitattributes
echo -e "foo\nfoo\nfoo" > kala.c
git add .gitattributes kala.c
git commit -m "Initial checkin."
cd ..
# Pretend test1 is not a local repository and someone else does this on Windows
git clone test1 test2
cd test2
git config core.autocrlf true
git status

# On branch master
nothing to commit (working directory clean)

Now the user would have to know that even though git status claims
everything is ok, that is not the case.  The user would have to
know to say (according to #git):

rm .git/index
git reset --hard

Just for the record, when I started to learn git, one of the first
questions I had was "how do I undo checkout?"  It wasn't until now
that I learned I need to remove .git/index (in addition to all
files).

-- 
Hannu

  reply	other threads:[~2008-11-03 15:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-02 16:33 .gitattributes glob matching broken Hannu Koivisto
2008-11-03  9:09 ` Jeff King
2008-11-03 15:05   ` CRLF support bugs (was: Re: .gitattributes glob matching broken) Hannu Koivisto
2008-11-03 15:25     ` Hannu Koivisto [this message]
2008-11-03 16:46     ` Dmitry Potapov
2008-11-03 22:24       ` CRLF support bugs Hannu Koivisto
2008-11-04  5:14     ` CRLF support bugs (was: Re: .gitattributes glob matching broken) Jeff King
2008-11-04 12:37       ` CRLF support bugs (was: Re: .gitattributes glob matchingbroken) Kelly F. Hickel
2008-11-05  3:07         ` Jeff King

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=83skq8al29.fsf@kalahari.s2.org \
    --to=azure@iki.fi \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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