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

Re: crlf with git-svn driving me nuts...

From
Nigel Magnay <nigel.magnay@gmail.com>
Date
Apr 17, 2008, 22:03 UTC
Message-ID
<320075ff0804171503g6dc04aa5pb7c9c362e31ce942@mail.gmail.com>
In-Reply-To
<20080417185357.GO3133@dpotapov.dyndns.org>
>  lose anything and you can set eol=native later. Unfortunately, now SVN
>  users forget to set eol=native a way too often. So, IMHO, Git approach
>  based on heuristic is much better when most of stored files are text.
>
I agree - since the forgetful users includes us!
Show 9 quoted lines
>
>  > so maybe it's just easier to coax those projects into fixing
>  > their svn repos (but of course it's not really an issue for them, so
>  > it might be a bit of a hard sell).
>
>  If they care about support different platforms then it _is_ issue
>  for them too. On the other hand, if everyone uses Windows with CRLF,
>  you can do that with Git too just by setting autocrlf=false.
>

Actually it seems to be less of an everyday issue- but I think it's because the diff tools in use by programs downstream are probably stripping CRs anyway before presenting diffs, so it all 'appears' to be right. Certainly I've been sharing via a svn repo through Eclipse with windows users for ages without it being a problem. Either way, the problem in touched/untouched-files was the majority of my confusion as I wasn't expecting to find a bug and was assuming I was doing something wrong...

Show 25 quoted lines
>
>  >
>  > Yes, in the sense that git is primarily a *nix tool, so it treats LF
>  > as canon
>
>  and perhaps even more important, it is written in C and where LF has
>  always been considered as EOL since the first Hello-World program was
>  written in C:
>
>    printf("Hello world!\n");
>  -----------------------^^
>
>  So, naturally LF is considered as EOL inside of Git. Actually, CVS does
>  so, and even SVN does if you set eol=native.
>
>
>  > and CRLF as somehow 'stupid' (I.E you could make an equally
>  > valid argument for the reverse position, it just depends on your
>  > perspective ;-)) ;
>
>  There is no good technical reason to have two symbols as the end-of-line
>  marker instead of one. Most programs on Windows just remove CR when read
>  from a file and then adding it back before LF when writing it back. So,
>  CR is clearly redundant.
>

Well.... Newline = LF vs CRLF (vs CR for early mac.. erk) dates to well before C and UNIX; back into the days of baudot codes and teletype printers that couldn't physically newline in the time taken for 1 character to be processed; LF is meant to mean Line Feed and CR is meant to mean "Carriage Return", so CRLF is in that sense quite logical. But that's standards committees and backwards compatibility for you :-/

Previous: Dmitry PotapovNext: Dmitry Potapov
Message 17 of 19 in “crlf with git-svn driving me nuts...”
  1. Nigel MagnayApr 16, 2008
  2. Dmitry PotapovApr 16, 2008
  3. Avery PennarunApr 16, 2008
  4. Dmitry PotapovApr 16, 2008
  5. Nigel MagnayApr 16, 2008
  6. Martin LanghoffApr 16, 2008
  7. Avery PennarunApr 16, 2008
  8. Dmitry PotapovApr 16, 2008
  9. Avery PennarunApr 16, 2008
  10. Nigel MagnayApr 16, 2008
  11. Dmitry PotapovApr 17, 2008
  12. Avery PennarunApr 17, 2008
  13. Nigel MagnayApr 17, 2008
  14. Dmitry PotapovApr 17, 2008
  15. Nigel MagnayApr 17, 2008
  16. Dmitry PotapovApr 17, 2008
  17. Nigel MagnayApr 17, 2008
  18. Dmitry PotapovApr 17, 2008
  19. Steffen ProhaskaApr 17, 2008

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.