Re: Automatic core.autocrlf?
- From
- Robert Dailey <rcdailey.lists@gmail.com>
- Date
- Aug 30, 2018, 14:57 UTC
- Message-ID
- <CAHd499BCk4Q4oPY=CXK=YrUbNUbz4J_KoeQngfz=92Qfc6q=eA@mail.gmail.com>
- In-Reply-To
- <20180830045407.GB140348@aiede.svl.corp.google.com>
On Wed, Aug 29, 2018 at 11:54 PM Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 19 quoted lines
> > Hi, > > Robert Dailey wrote: > > > Is there an 'auto' setting for the 'core.autocrlf' config? Reason I > > ask is, I want that setting to be 'input' on linux but 'true' on > > Windows. > > Others are exploring your question about the configuration language, > but I want to emphasize some other ramifications. > > Why do we still have 'core.autocrlf'? Do 'core.eol' and related > settings take care of that need, or is autocrlf still needed? If > core.eol etc do not take care of this need, what should we do to get > them to? > > Thanks, after having run into a few too many autocrlf-related messes, > Jonathan
From my perspective, the confusion is due to the evolution of the feature. There's multiple ways to control EOL handling but most of it is legacy/backward compatibility, I think. core.autocrlf is a fall-back for repos that do not have a .gitattributes. Because .gitattributes is optional by design, I'm not sure if getting rid of the config options is a good idea. But your point did make me think about how `core.autocrlf = true` should probably be a system config default for the Git for Windows project. The default for that value should be platform-defined. That would make it automatically work the way I want, and might solve a lot of the issues where people are committing CRLF into repositories on Windows.