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

Re: Automatic core.autocrlf?

From
Torsten Bögershausen <tboegi@web.de>
Date
Aug 30, 2018, 18:56 UTC
Message-ID
<20180830185648.GA10427@tor.lan>
In-Reply-To
<CAHd499BCk4Q4oPY=CXK=YrUbNUbz4J_KoeQngfz=92Qfc6q=eA@mail.gmail.com>
On Thu, Aug 30, 2018 at 09:57:52AM -0500, Robert Dailey wrote:
Show 27 quoted lines
> On Wed, Aug 29, 2018 at 11:54 PM Jonathan Nieder <jrnieder@gmail.com> 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.

Show 6 quoted lines
> 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 ?

Previous: Robert DaileyNext: Randall S. Becker
Message 11 of 15 in “Automatic core.autocrlf?”
  1. Robert DaileyAug 27, 2018
  2. Torsten BögershausenAug 27, 2018
  3. Duy NguyenAug 27, 2018
  4. Robert DaileyAug 27, 2018
  5. Andrei RybakAug 27, 2018
  6. Andrei RybakAug 27, 2018
  7. brian m. carlsonAug 28, 2018
  8. Robert DaileyAug 30, 2018
  9. Jonathan NiederAug 30, 2018
  10. Robert DaileyAug 30, 2018
  11. Torsten BögershausenAug 30, 2018
  12. Randall S. BeckerAug 30, 2018
  13. Jonathan NiederAug 31, 2018
  14. Randall S. BeckerAug 31, 2018
  15. Torsten BögershausenAug 31, 2018

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.