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

Re: [PATCH/RFC v2 1/4] Add "core.eolStyle" variable to control end-of-line conversion

From
Finn Arne Gangstad <finnag@pvv.org>
Date
May 9, 2010, 18:18 UTC
Message-ID
<20100509181853.GA4676@pvv.org>
In-Reply-To
<7v632x9dfk.fsf@alter.siamese.dyndns.org>
On Sun, May 09, 2010 at 10:45:35AM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com> writes:
> 
> > My user interface would have been:
> >
> > - an attribute "eolconv" that enables or disables line ending conversion
> > - a config variable "core.eolconv" that sets "eolconv" for all files where it is unset
> > - a config variable "core.localeol" that decides whether LF or CRLF is preferred
> 
> I am puzzled about this second item; what is its type and what is its
> purpose?  If it is to allow project-wide default to be specified, then
> isn't having "* eolconv=true" in .gitattributes a much better option and
> is already supported by the first item?

The way I understood it core.eolconv has exactly the same possible values as the "eolconv" attribute, and serves as a default value for "eolconv" if it isn't set. This would (mostly, I guess) be for Windows users who would like to check out a project that is primarily developed on Unix and didn't bother to set any eolconv attributes, and still get CRLF line endings. core.eolconv has some of the drawbacks of autocrlf, so shouldn't really be used if you can convince projects to add eolconv attributes instead.

Are you thinking we could live completely without it? Most other popular vcs-systems have eol-conversion/normalisation on by default, while git has it disabled by default. The config variable can change the default behaviour, but is isn't as helpful as it should have been perhaps.

To do a better job with old un-normalised repos, we could for each file remember what their eol-style was (CR, LF, CRLF, mixed), and then even if doing output conversion on checkout, convert back to the same eol style on commit. This would perhaps break down a bit for renames, but would be lovely if it worked for merges for example...

- Finn Arne
Previous: Junio C HamanoNext: Junio C Hamano
Message 26 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.