0

How can I safely configure git-svn so I don't unintentionally change line endings when dcommitting to svn?

I'm currently using git's autocrlf=false and Unix file shows a mix of line endings:

> file *
actionbutton.lua:         ASCII text, with CRLF line terminators
animbutton.lua:           ASCII text

And not all files have svn:eol-style set:

> git svn propget svn:eol-style actionbutton.lua
`actionbutton.lua' does not have a `svn:eol-style' SVN property.

> git svn propget svn:eol-style animbutton.lua
native

This project uses the editorconfig setting end_of_line = crlf which causes my editor to change line endings in files I edit. I didn't experience this problem when using svn directly (without git-svn).

The svn docs say that svn:eol-style=native stores line endings as LF:

by default, Subversion doesn't pay any attention to the type of end-of-line (EOL) markers used in your files...

native:

Note that Subversion will actually store the file in the repository using normalized LF EOL markers regardless of the operating system. This is basically transparent to the user, though.

So I guess git-svn is skipping the LF->CRLF process that svn does because I've disabled autocrlf?

git docs for autocrlf say:

If you’re a Windows programmer doing a Windows-only project, then you can turn off this functionality, recording the carriage returns in the repository by setting the config value to false

Everyone's on Windows, so we all expect CRLF. That describes my project, but I can't tell how it's going to interact with svn.

idbrii
  • 10,975
  • 5
  • 66
  • 107
  • Read the *first* paragraph on the `native` setting: you will get CRLF on a Windows *working copy* the note is about the repo which is something else and which you don't see. Everything seems to work fine and as documented or am I missing something? – Friedrich May 04 '23 at 17:49
  • "This causes the file to contain the EOL markers that are native to the operating system on which Subversion was run." That's the behaviour when cloning with `svn` but not with `git-svn`. – idbrii May 05 '23 at 14:02
  • I see. As there are still no answers, you might have to test all permutations of line endings and options. – Friedrich May 07 '23 at 19:59

0 Answers0