what EVIL agent (IDEA or subversion?) is changing my line end chars?

I have seen this several times now: unix shell files (*.sh) in our subversion source control system are getting turned into PC format text files (\r\n) on my machine (a win xp sp3 box). Then, when I go to upload these files to a linux server, they of course fail to execute. Was a royal pain to diagnose this the first time.

I am pretty sure that these files were originally (and still are?) stored as unix format text files (\n) on our subversion server. My team's subversion guru swears that subversion will not "translate" file line ends to match what my local operating system uses by default, but instead always sends me the true data. To make an analogy with ftp sessions, his claim is that subversion solely operates in binary mode and never in evil text mode.

Is this claim about subversion true?

And if it is, then it means that IDEA must be changing line ends to match my local operating system, right? How do I suppress IDEA from such bad behavior? I searched in the help system, and did not find what I want. (I did specify in my code settings to have all new files created with unix format line ends, but this does not seem to stop the behavior that I describe above.)

3 comments
Comment actions Permalink

If subversion property svn:eol-style is set to 'native' for these .sh files then subversion will translate line end characters to CRLF on Windows when you do a checkout.
Remove property svn:eol-style to disable this behavior. Or you could set svn:eol-style to LF to force them to have unix line endings no matter how they are created.
See http://svnbook.red-bean.com/en/1.4/svn.advanced.props.file-portability.html#svn.advanced.props.special.eol-style

0
Comment actions Permalink

If subversion property svn:eol-style is set to 'native' for these .sh files then subversion will translate line end characters to CRLF on Windows when you do a checkout.
Remove property svn:eol-style to disable this behavior. Or you could set svn:eol-style to LF to force them to have unix line endings no matter how they are created.
See http://svnbook.red-bean.com/en/1.4/svn.advanced.props.file-portability.html#svn.advanced.props.special.eol-style


Thanks a lot. Indeed, my copy of IDEA was configured with the subversion property svn:eol-style set to 'native'. I am deleting this property entirely.

0
Comment actions Permalink

If other people use the project you change that property on that may be a rude surprise to those other people. You may be better off just using ANT's fixcrlf task (assuming you use ANT) as part of your build:

http://ant.apache.org/manual/CoreTasks/fixcrlf.html

0

Please sign in to leave a comment.