Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-17-2009, 04:41 PM   #1
LQ Newbie
Registered: Jan 2006
Distribution: Slackware Linux
Posts: 21

Rep: Reputation: 15
Cool svn checkout failes to add corret EOL on windows machine

We are using svn client version 1.5.6. I was able to setup svn server on linux server successfully. The server is working fine for linux machies. I.e. if they checkout/checkin source code, the line endings are unix style. The problem comes when the source is checkouted on Windows machine. SVN client does not automatically add 0xd at the end of line. Instead of that the line ending is unix style - 0xa . I tried to change config file in this way:

enable-auto-props = yes

*.PL = svn:eol-style=native
*.pl = svn:eol-style=native
*.cpp = svn:eol-style=native
*.c = svn:eol-style=native
*.h = svn:eol-style=native
*.dsp = svn:eol-style=native
*.dsw = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
*.SH = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=native

But it looks like this is used when I commit or import files onlyn
When I checkout source files (.c for example) they have incorrect EOL.

Searching the net I found another approach:
svn propset -R svn:eol-style native .
This command is valid only if:
1. I checkout the sources.
2. change to work directory.
3. execute the command.
4. delete checkout-ed files without deleting .svn directories or their content.
5. execute svn update. In this case EOL's are ok.

My question is quite simple.
Is there any easy way to tell svn client to add correct EOL symbols when I'm checkouting source, and restoring the EOL to original one when I'm committing the source ?
I know that there are external programs that can do the conversion, but I would like to avoid this.

Thank you in advance for your answers.
Old 03-19-2009, 01:31 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You basically have the correct solution to the problem:


This causes the file to contain the EOL markers that are native to the operating system on which Subversion was run. In other words, if a user on a Windows machine checks out a working copy that contains a file with an svn:eol-style property set to native, that file will contain CRLF EOL markers. A Unix user checking out a working copy which contains the same file will see LF EOL markers in his copy of the file.

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.
However, perhaps you should do this:

a) set svn:eol-style=lf on each of the text files in your repository
b) set svn:eol-style=native on all clients that check-out/update these files
You might also consider setting MIME type and EOF settings in the same configuration file, and making sure all your clients can share a standard SVN configuration file. Here are a couple of examples:

'Hope that helps .. PSM

I also just stumbled across this gem:
Have you looked at svn:eol-style=share?

That keeps the line endings in the repository as Unix LF, but changes
them in your working copy depending upon the platform you use. On
Unix, they'll be LF, on Windows, they'll be CRLF.

Last edited by paulsm4; 03-19-2009 at 01:35 AM.


checkout, svn, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SVN Checkout Error? your_shadow03 Linux - Server 2 02-13-2009 04:29 AM
svn checkout -bash svn command not found Anauj0101 Linux - Newbie 6 04-20-2008 05:50 PM
Not able to add two different projects in SVN (Linux server) deepaklinux Linux - Software 1 02-14-2008 02:02 AM
svn checkout keith2045 Linux - General 3 11-15-2007 09:15 PM
how to add a linux machine to a windows 2003 domain ? whisper Linux - Newbie 1 02-09-2007 05:53 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration