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

Re: core.autocrlf considered half-assed

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Mar 9, 2010, 07:24 UTC
Message-ID
<20100309072412.GF31105@dpotapov.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.1003081225280.14277@intel-tinevez-2-302>
On Mon, Mar 08, 2010 at 12:29:01PM +0100, Johannes Schindelin wrote:
Show 8 quoted lines
> 
> 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

As Junio explained in another mail, it was intentional to have all HTML files with CRLF, because they are supposed to have that ending on all platforms. What is missing, however, is .gitattributes, which would tell to Git that we do not want to autocrlf conversion for HTML files. This can be done by adding .gitattributes:

$ cat >> .gitattributes <<EOF *.html -crlf EOF

I've just noticed that user-manual.html differs from other HTML files in that it uses LF ending. I think it is a mistake, and this file should be converted to have CRLF, but if you want to have all HTML files except user-manual.html to have CRLF then you can do that too:

$ cat > .gitattributes <<EOF *.html -crlf user-manual.html crlf EOF

I hope Junio will add the right version of .gitattributes, so users with autocrlf=true will not suffer.

Dmitry
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 12 in “core.autocrlf considered half-assed”
  1. Johannes SchindelinMar 5, 2010
  2. Dmitry PotapovMar 7, 2010
  3. Linus TorvaldsMar 7, 2010
  4. TaitMar 8, 2010
  5. Johannes SchindelinMar 8, 2010
  6. Junio C HamanoMar 8, 2010
  7. Johannes SchindelinMar 9, 2010
  8. Junio C HamanoMar 9, 2010
  9. Johannes SchindelinMar 8, 2010
  10. Dmitry PotapovMar 9, 2010
  11. Johannes SchindelinMar 9, 2010
  12. Dmitry PotapovMar 9, 2010

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.