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

Re: autocrlf

From
APAndy Parkins <andyparkins@gmail.com>
Date
May 18, 2007, 12:32 UTC
Message-ID
<200705181332.55228.andyparkins@gmail.com>
In-Reply-To
<464D91E7.FB3F9B4@eudaptics.com>
On Friday 2007 May 18, Johannes Sixt wrote:
Show 8 quoted lines
> > What actually happens is that any file with the crlf attribute is being
> > checked out with LF expanded to CRLF (I'm running Linux of course), which
> > is completely not what I wanted.
>
> If I understand the documentation correctly
> (Documentation/gitattributes.txt) then you set core.autocrlf to true on
> Windows and false everywhere else, and things should start working like
> you imagined.

Presumably then it is defaulting to false for Linux as everything is working fine for me at present. However, that is not the case when I set the crlf attribute.

Documentation/gitattributes.txt:
This attribute controls the line-ending convention.
Set::
    Setting the `crlf` attribute on a path is meant to mark
    the path as a "text" file.  'core.autocrlf' conversion
    takes place without guessing the content type by
    inspection.

I read that as meaning the automatic detection of file type is overridden by the crlf attribute. What I'm actually seeing is that it has the same effect as enabling "autocrlf = true" for that file. As you say "autocrlf = true" is for windows, the crlf attribute should not be forcing it on as that then applies to all platforms.

I think this is a bug. The code agrees with the observed behaviour but not with the documentation. Patch to follow.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
Previous: Johannes Sixt
Message 5 of 5 in “autocrlf”
  1. Andy ParkinsMay 18, 2007
  2. Raimund BauerMay 18, 2007
  3. Andy ParkinsMay 18, 2007
  4. Johannes SixtMay 18, 2007
  5. Andy ParkinsMay 18, 2007

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.