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

Re: [PATCH] Add "core.eol" variable to control end-of-line conversion

From
Robert Buck <buck.robert.j@gmail.com>
Date
May 16, 2010, 10:39 UTC
Message-ID
<AANLkTin-KO8n591Hz7BuJCaHCe4osfCvUhH4ua0beyXt@mail.gmail.com>
In-Reply-To
<1273956445-67531-1-git-send-email-eyvind.bernhardsen@gmail.com>

On Sat, May 15, 2010 at 4:47 PM, Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com> wrote:

Show 41 quoted lines
> Introduce a new configuration variable, "core.eol", that allows the user
> to set which line endings to use for end-of-line-normalized files in the
> working directory.  It defaults to "native", which means CRLF on Windows
> and LF everywhere else.
>
> For backwards compatibility, "core.autocrlf" will override core.eol if
> core.eol is left unset.  This means that
>
> [core]
>        autocrlf = true
>
> will give CRLFs in the working directory even on platforms with LF as
> their native line ending.
>
> If core.eol is set explicitly (including setting it to "native"), it
> will override core.autocrlf so that
>
> [core]
>        autocrlf = true
>        eol = lf
>
> normalizes all files that look like text, but does not put CRLFs in the
> working directory.
>
> Signed-off-by: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
> ---
>
> It turns out that my resistance to "core.eol" was mostly laziness, so I
> just implemented it.
>
> I decided that "core.autocrlf" has to override the native line ending if
> "core.eol" isn't set explicitly, which gives some extra complexity in
> convert.c.
>
> For 1.8 I would consider making core.autocrlf just turn on normalization
> and leave the working directory line ending decision to core.eol, but
> that _will_ break people's setups.
>
> Patch is on top of my latest series.
> --
> Eyvind

Looking forward to this change. In terms of usability it is really nice. Eager to see it in a release.

Previous: Eyvind BernhardsenNext: Eyvind Bernhardsen
Message 26 of 27 in “End-of-line normalization, redesigned”
  1. 0/5 End-of-line normalization, redesignedEyvind Bernhardsen, May 12, 2010
  2. 1/5 autocrlf: Make it work also for un-normalized repositoriesEyvind Bernhardsen, May 12, 2010
  3. 2/5 Add tests for per-repository eol normalizationEyvind Bernhardsen, May 12, 2010
  4. 3/5 Add per-repository eol normalizationEyvind Bernhardsen, May 12, 2010
  5. 4/5 Rename "crlf" attribute as "eolconv"Eyvind Bernhardsen, May 12, 2010
  6. Linus TorvaldsMay 13, 2010
  7. Robert BuckMay 13, 2010
  8. Robert BuckMay 13, 2010
  9. Eyvind BernhardsenMay 13, 2010
  10. Robert BuckMay 13, 2010
  11. utf8 BOMDmitry Potapov, May 14, 2010
  12. Eyvind BernhardsenMay 15, 2010
  13. Dmitry PotapovMay 16, 2010
  14. Eyvind BernhardsenMay 16, 2010
  15. TaitMay 16, 2010
  16. Dmitry PotapovMay 16, 2010
  17. Eyvind BernhardsenMay 13, 2010
  18. Linus TorvaldsMay 13, 2010
  19. Robert BuckMay 14, 2010
  20. Jonathan NiederMay 14, 2010
  21. Eyvind BernhardsenMay 14, 2010
  22. Eyvind BernhardsenMay 14, 2010
  23. Eyvind BernhardsenMay 14, 2010
  24. Linus TorvaldsMay 14, 2010
  25. Add "core.eol" variable to control end-of-line conversionEyvind Bernhardsen, May 15, 2010
  26. Robert BuckMay 16, 2010
  27. 5/5 Rename "core.autocrlf" config variable as "core.eolconv"Eyvind Bernhardsen, May 12, 2010

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.