Svn eol-style: Difference between revisions

From EggeWiki
mNo edit summary
mNo edit summary
 
Line 21: Line 21:
<geshi lang="bash">
<geshi lang="bash">
svn propset svn:executable ON *.sh
svn propset svn:executable ON *.sh
<geshi>
</geshi>


[[Category:bash]]
[[Category:bash]]
[[Category:cygwin]]
[[Category:cygwin]]
[[Category:svn]]
[[Category:svn]]

Latest revision as of 22:57, 4 August 2009

The svn:eol-style can be a bit controversial. It's implementation is quite complicated, and it can cause a number of issues - mostly when set to native.

For bash files, the eol style should always be LF. This is because a bash script whether running under Cygwin or a real unix does not handle CR's in the file.

If you have carriage returns in your bash script, you'll be greeted with a message like: <geshi lang="bash"> line 2: $'\r': command not found </geshi>

To fix this, change the eol-style to LF for your bash scripts.

<geshi> svn pset svn:eol-style LF *.sh svn commit -m "changed EOL style to LF" </geshi>

After the commit, the files will be updated with the correct line ending.

Additionally, you may want to set the executable property. This way, when the script is checked out on a Unix platform it will be executable.

<geshi lang="bash"> svn propset svn:executable ON *.sh </geshi>