Subject: RE: Automatic core.autocrlf?

From: "Randall S. Becker" <[email-masked]>
Date: Thu, 30 Aug 2018 15:10:23 -0400

On August 30, 2018 2:57 PM, Torsten Bögershausen wrote:
> On Thu, Aug 30, 2018 at 09:57:52AM -0500, Robert Dailey wrote:
> > On Wed, Aug 29, 2018 at 11:54 PM Jonathan Nieder <[email-masked]>
> wrote:
> > >
> > > 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.
> 
> Good summary. My original plan was to try to "make obsolete"/retire and
> phase out core.autocrlf completely.
> However, since e.g. egit/jgit uses it
> (they don't have support for .gitattributes at all) I am not sure if this
is a good
> idea either. Opinions are welcome.
> 
> 
> > 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.
> 
> Unless I am wrong, that had been the default a long time ago:
> Git for Windows (at that time msysgit) had core.autocrlf=true by default.
> While this is a good choice for many repos, some people prefer
> core.autocrlf=input.
> Others just commit files for Windows-based repos with CRLF, and the
> advantage is, that "git diff" doesn't show "^M" somewhere.
> 
> I allways encourage people to set up a .gitattributes file.
> Does anybody thinks that we can make core.autocrlf obsolete ?

The last time I checked, EGit does not set this by default. ECLIPSE Oxygen
3A/EGit-JGit 5.0.1, when running on Windows, creates core.filemode=false,
core.logallrefupdates=true, repositoryformatversion=0, symlinks=false. Some
SourceTree versions that predate the newer SourceTreeApp are somewhat stuck
on older embedded versions of git, but that may not be relevant. Personally,
I would seriously like to drop core.autocrlf and just have everyone on LF
EOL characters. I get frequently burnt by this despite knowing better.

Cheers,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.