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

Re: Automatic core.autocrlf?

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Aug 27, 2018, 17:29 UTC
Message-ID
<CAHd499AFUtW3=JNrmevdHRLgfK+QSdpkkSj0wsbRkhE8tqu-rA@mail.gmail.com>
In-Reply-To
<CACsJy8Bik2Hokgv46ifsFhhvGzdcB=FoWnWs6_k2361s15wOPA@mail.gmail.com>
On Mon, Aug 27, 2018 at 10:53 AM Duy Nguyen <pclouds@gmail.com> wrote:
Show 12 quoted lines
>
> On Mon, Aug 27, 2018 at 5:37 PM Torsten Bögershausen <tboegi@web.de> wrote:
> > > In those cases, when it falls back to
> > > configuration for line ending management, I want it to be
> > > automatically configured based on the host platform.
> >
> > There is
> > git config core.eol native
>
> An alternative is supporting conditional config includes based on
> platform or host name, but I don't know if there are more use cases
> like this to justify it.

To Torsten's comment: Yes, I've looked at git-config. it doesn't have the answer to my question there, hence I posted on the mailing list. To your point, eol being native doesn't matter if text=auto can't be simulated. If there was a version of `autocrlf` that set `eol=native` and `text=auto`, that would work as well. But the `true` setting sets `text=auto` and `eol=crlf`.

Duy: There are more use cases I've run into, but they are not related to the OP:
* Different user email between machines (work vs personal)
* Different tooling on platform (e.g. `nano` on Ubuntu, Notepad++ on Windows)

Centralizing .gitconfig, especially when you have tons of aliases, becomes more important. 95% of my .gitconfig is platform-agnostic, if there was an `#ifdef` mechanism, per your suggestion, this would allow a lot more flexibility. Maybe I should have worded my OP more in terms of platform-specific configuration sections, instead of specifically about autocrlf, since that's just one symptom of the real problem.

Previous: Duy NguyenNext: Andrei Rybak
Message 4 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.