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

[PATCH/RFC v2 0/4] End-of-line normalization, take 2 (now only slightly scary)

From
Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Date
May 8, 2010, 21:46 UTC
Message-ID
<cover.1273352819.git.eyvind.bernhardsen@gmail.com>

Okay, here's a second shot at my end-of-line conversion sanification series. The main change is that instead of introducing a new attribute, I've added a new mode to the "crlf" attribute: "crlf=auto".

The semantics of "crlf" have also been modified slightly in that the attribute now enables end-of-line normalization whenever it is set, instead of simply amending what happens when "core.autocrlf" is enabled as it did before.

I think this version is a step in a direction that everyone can agree on. The new config variable seems to be a point of contention, but while I'm not married to the name "core.eolStyle" by any means, I don't think "core.crlf" explains what it is, and I don't think "input" and "true" are good ways of describing what it does.

I agree with Linus that "crlf=input" seems crazy, and I agree with Dmitry that "crlf" is a bad name for the attribute to begin with. This isn't bikeshedding: git has lost a lot of its sharp edges recently, but this one remains, and is quite an important one for Windows users.

For now, though, I'd like the focus for this patch series to be creating a mechanism that allows a project to enforce line ending normalization for all contributors to the repository, while letting the user decide what line endings he likes to see in his working directory. If we end up not shooting anybody in the head, all the better.

Thanks for all your inputs. I was worried that nobody would even notice this series :) I've expanded the Cc list a bit, hope that's okay.

Eyvind Bernhardsen (4):
    Add "core.eolStyle" variable to control end-of-line conversion
    Add tests for per-repository eol normalization
    Pass eol conv mode as an argument instead of using global auto_crlf
    Add per-repository eol normalization
 Documentation/config.txt        |   11 ++-
 Documentation/gitattributes.txt |   71 +++++++++++-----
 Makefile                        |    3 +
 cache.h                         |   19 ++++
 config.c                        |   16 +++-
 convert.c                       |   52 +++++++++---
 environment.c                   |    1 +
 t/t0025-crlf-auto.sh            |  180 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 317 insertions(+), 36 deletions(-)
 create mode 100755 t/t0025-crlf-auto.sh
Next: Eyvind Bernhardsen
Message 1 of 37 in “End-of-line normalization, take 2 (now only slightly scary)”
  1. 0/4 End-of-line normalization, take 2 (now only slightly scary)Eyvind Bernhardsen, May 8, 2010
  2. 1/4 Add "core.eolStyle" variable to control end-of-line conversionEyvind Bernhardsen, May 8, 2010
  3. Linus TorvaldsMay 8, 2010
  4. Eyvind BernhardsenMay 8, 2010
  5. Eyvind BernhardsenMay 8, 2010
  6. Linus TorvaldsMay 8, 2010
  7. Eyvind BernhardsenMay 9, 2010
  8. Linus TorvaldsMay 9, 2010
  9. Eyvind BernhardsenMay 9, 2010
  10. Dmitry PotapovMay 9, 2010
  11. hasen jMay 9, 2010
  12. Dmitry PotapovMay 10, 2010
  13. Eyvind BernhardsenMay 9, 2010
  14. Eyvind BernhardsenMay 9, 2010
  15. Robert BuckMay 9, 2010
  16. Eyvind BernhardsenMay 9, 2010
  17. Robert BuckMay 9, 2010
  18. Eyvind BernhardsenMay 10, 2010
  19. Robert BuckMay 10, 2010
  20. Robert BuckMay 10, 2010
  21. Dmitry PotapovMay 10, 2010
  22. Jay SoffianMay 9, 2010
  23. Jay SoffianMay 9, 2010
  24. Eyvind BernhardsenMay 10, 2010
  25. Junio C HamanoMay 9, 2010
  26. Finn Arne GangstadMay 9, 2010
  27. Junio C HamanoMay 9, 2010
  28. Eyvind BernhardsenMay 10, 2010
  29. Eyvind BernhardsenMay 9, 2010
  30. Finn Arne GangstadMay 9, 2010
  31. Dmitry PotapovMay 10, 2010
  32. Finn Arne GangstadMay 10, 2010
  33. Dmitry PotapovMay 10, 2010
  34. Finn Arne GangstadMay 9, 2010
  35. 2/4 Add tests for per-repository eol normalizationEyvind Bernhardsen, May 8, 2010
  36. 3/4 Pass eol conv mode as an argument instead of using global auto_crlfEyvind Bernhardsen, May 8, 2010
  37. 4/4 Add per-repository eol normalizationEyvind Bernhardsen, May 8, 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.