git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: CRLF support bugs

From
HKHannu Koivisto <azure@iki.fi>
Date
Nov 3, 2008, 15:25 UTC
Message-ID
<83skq8al29.fsf@kalahari.s2.org>
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
Previous: Hannu KoivistoNext: Dmitry Potapov
Message 4 of 9 in “.gitattributes glob matching broken”
  1. Hannu KoivistoNov 2, 2008
  2. Jeff KingNov 3, 2008
  3. CRLF support bugs (was: Re: .gitattributes glob matching broken)Hannu Koivisto, Nov 3, 2008
  4. Hannu KoivistoNov 3, 2008
  5. Dmitry PotapovNov 3, 2008
  6. Hannu KoivistoNov 3, 2008
  7. Jeff KingNov 4, 2008
  8. Kelly F. HickelNov 4, 2008
  9. Jeff KingNov 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.