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

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

From
Avery Pennarun <apenwarr@gmail.com>
Date
Apr 16, 2008, 20:03 UTC
Message-ID
<32541b130804161303i74a4dd3bw5ef72105ebf5485b@mail.gmail.com>
In-Reply-To
<320075ff0804161210m46f3e83bpf7bf9d1d5816d914@mail.gmail.com>
On 4/16/08, Nigel Magnay <nigel.magnay@gmail.com> wrote:
>  Why does it think in this instance that there is a change? It's CRLF
>  in the repo, it's CRLF in the working tree, and the checkout in either
>  mode ought to be identical ??

We got quite confused by this here too. I'm pretty sure git's autocrlf feature is buggy, as you've noticed. Combined with that, svn has its *own* kind of autocrlf feature (svn:eol-style property on each file) that acts completely differently.

As an added bonus, I don't know if you've run into this yet, but cygwin's "patch" command seems to unconditionally strip CR from patches *before* trying to apply them at all, *even if* the target file is CRLF, so patches just never apply to CRLF files ever. Ha ha!

I managed to make the two systems stop stomping on each other, in our case, by using svn:eol-style of "native" (which means when git-svn checks out the file, it gets only LF, since it seems to always claim to be Unix) and not using git's autocrlf at all. However, this isn't optimal since then Windows git users end up with LF instead of CRLF in their files, which confuses them.

On the other hand, the conflicts and the random-newline-changing diffs go away, as svn fixes things up at checkin time no matter how badly they got mangled by the windows user (most commonly, they run a program that resaves the whole file as CRLF).

Obviously a working git autocrlf feature would be better, but I haven't looked into it closely enough to say where the problem actually lies.

Have fun,
Avery
Previous: Dmitry PotapovNext: Nigel Magnay
Message 9 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.