Subject: Re: [RFC/PATCH v3 4/5] Rename "crlf" attribute as "eolconv"

From: Jonathan Nieder <[email-masked]>
Date: Thu, 13 May 2010 23:56:46 -0500

Hi Bob,

Robert Buck wrote:

> *   text
> *.foo  binary
> 
> means autoconvert everything regardless of the autocrlf setting,
> except for .foo files ? So now we can dispense with the autocrlf
> attribute altogether if we so wish?

If I understand correctly, there is no autocrlf attribute, just a
configuration item.  If you put

 * crlf
 *.foo -crlf

in your .gitattributes with current git, this means:

 - if the '[core] autocrlf' configuration is not set, do not convert
   anything;

 - otherwise, convert everything except for .foo files

Eyvind’s series improves that in a few ways.

 - [from Finn Arne Gangstad] If the in-repository copy of a file
   contains any carriage returns, do not try to convert it.  This
   makes it easier to deal with mistakes.

 - For files with crlf enabled through attributes, always convert,
   whether '[core] autocrlf' is enabled or not.

 - Use the '[core] autocrlf' setting to determine the desired
   line-ending for checked-out files (\r\n if true, \n otherwise).
   A new eol attribute is provided to override that setting.

 - The crlf attribute gets a new synonym "text" to avoid confusion.

There is also some change to the result of file type autodetection,
but as long as your .gitattributes uses '* crlf' or '* -crlf', there
is no need to worry about this.

Hope that helps,
Jonathan