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

Re: [RFC/PATCH v3 4/5] Rename "crlf" attribute as "eolconv"

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 13, 2010, 01:38 UTC
Message-ID
<alpine.LFD.2.00.1005121824260.3711@i5.linux-foundation.org>
In-Reply-To
<6dd7bef7811283b03b8b9dac93c9a264d007bcb0.1273700831.git.eyvind.bernhardsen@gmail.com>
On Thu, 13 May 2010, Eyvind Bernhardsen wrote:
Show 11 quoted lines
>  
>  ------------------------
> -*.txt          crlf
> -*.vcproj       crlf=crlf
> -*.sh           crlf=lf
> -*.jpg          -crlf
> +*.txt          eolconv
> +*.vcproj       eolconv=crlf
> +*.sh           eolconv=lf
> +*.jpg          -eolconv
>  ------------------------
...
>  ------------------------
> -*	crlf=auto
> +*	eolconv=auto
>  ------------------------
If you are doing the renaming, then I seriously object to this.

It makes no sense to say "eolconv=crlf" and then say "eolconv=auto". They are two totally different things. One is _how_ line endings should look like, and the other is _whether_ line endings exist or not.

And "eolconv=crlf" makes no sense anyway. I assume "conv" is conversion, but a conversion implies a from and a to. That's just a "to", and it would make much more sense to just say "eol=crlf" for that case.

Now, it _does_ make sense to say "eolconv=auto", but that's because it's that totally different case: it's not about what the line ending character is, it's about whether any eol conversion is done at all. So for _that_ case, it makes sense to use "eolconv", although even for that case I think the name is not very _good_. So if you rename these things, keep them separate. Make the "am I a text-file" boolean be a boolean (plus "auto"), and just call it "text". And make the "what end of line to use" be just "eol" then.

So you can have
	*	text=auto,eol=crlf
that means "autodetect whether it is text, and use crlf as eol".
Now, I'd further suggest:
 - "eol=xyz" with no "text" attribute automatically implies "text" being 
   true.
 - "text=xyz" with no "eol" attribute implies "eol=native"
so now you can write:
	*.jpg -text
	*.txt text
	*.vcproj eol=crlf
	*.sh eol=lf
	* text=auto
and that means:
 - jpg files are binary
 - *.txt files are text, and we use the default ("native") line ending for 
   them (implicit, since we don't have any matcing eol rule)
 - *.vcproj files are text (implicit), and we use CRLF line endings
 - *.sh files are text (implicit), and we use UNIX style line endings
 - everything else is auto-detected, and we implicitly use native line 
   endings for them
Doesn't that look finally sane?
Because if we really renaem the attributes, let's rename them _right_.
			Linus
Previous: Eyvind BernhardsenNext: Robert Buck
Message 6 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.