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

Re: possible gitattributes eol bug with new eol=crlf | lf support?

From
Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Date
Sep 13, 2010, 19:49 UTC
Message-ID
<EBF8B701-6DD6-4D7A-AE2D-49561B4FD7C6@gmail.com>
In-Reply-To
<AANLkTi=9Wv9_s2zDEdpc8Dn7qXSRepZSToKkOrAoTQnR@mail.gmail.com>
On 12. sep. 2010, at 21.58, Robert Buck wrote:
> Thanks Eyvind,
> 
> I tried it on an experimental repository and it worked. Thank you for
> your recommendation.
Great :)
Show 9 quoted lines
> I also found the following link at github which achieves a similar
> effect. Adding this for the record in case someone else searching for
> a solution in the future wanted more detail.
> 
>    http://help.github.com/dealing-with-lineendings/
> 
> The one thing I find curious about the github article is that it seems
> to recommend using autocrlf=true for ALL platforms once the linefeeds
> have been normalized.
That article hasn't been updated for 1.7.2, but what it's saying is that line ending normalisation should be enabled for all users (or none) if you want to avoid problems.
The point of the text attribute is to allow you to enable or disable line ending normalisation without the user having to configure anything; setting the attribute "text=auto" on all files is equivalent to every user manually setting autocrlf to "true" or "input" in that repository.
[...]
> So if we did this one-time normalization on all repositories, all
> branches, what holistic approach (eol, autocrlf) would keep our files
> sane for a mix of 1.7.2 and later, and 1.7.0.1 and earlier, Windows,
> Mac, and Linux?
I would set the text attribute to auto for all files (add the line "* text=auto" to .gitattributes) to take care of users with git 1.7.2 or newer.  Users with older versions of git should set autocrlf=true (Windows) or autocrlf=input (Mac and Linux).
Once all users are upgraded to newer versions of git you can change the normalisation to target only specific files or file types, but that's not advisable while any of your users have autocrlf enabled.
- Eyvind
Previous: Robert Buck
Message 6 of 6 in “possible gitattributes eol bug with new eol=crlf | lf support?”
  1. Robert BuckSep 9, 2010
  2. Eyvind BernhardsenSep 10, 2010
  3. Robert BuckSep 10, 2010
  4. Eyvind BernhardsenSep 12, 2010
  5. Robert BuckSep 12, 2010
  6. Eyvind BernhardsenSep 13, 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.