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

Re: Automatic core.autocrlf?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 28, 2018, 00:14 UTC
Message-ID
<20180828001403.GA432229@genre.crustytoothpaste.net>
In-Reply-To
<94afe154-53e1-761a-4a66-4f77188036f7@gmail.com>
On Mon, Aug 27, 2018 at 07:32:08PM +0200, Andrei Rybak wrote:
Show 21 quoted lines
> On 2018-08-27 17:52, Duy Nguyen wrote:
> > 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.
> >>
> > 
> > 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.
> > 
> 
> How about just using unconditional includes?
> 
> global.gitconfig (synced across machines):
> 
>   [include]
>       path = platform-specific.gitconfig
> 
> And two version of file named "platform-specific.gitconfig", which
> are not synced, and include only code.autocrlf setting.

There's actually a way to do this that works with older Git versions as well: put global config in .gitconfig and per-system config in .config/git/config. Or you can use some sort of script (say, a Makefile) to install the proper values based on your system.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Andrei RybakNext: Robert Dailey
Message 7 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.