[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: ^M Appends to every line?

From: David Chapman <dcchapman_at_acm.org>
Date: Wed, 23 Feb 2011 08:35:00 -0800

On 2/23/2011 8:19 AM, Christopher D Haakinson wrote:
> I have SVN up and running and things are working well, except when
> editing shell scripts from windows.
> My server is RHEL5-based and I will have clients connecting from linux
> and windows. Linux commits work great, and even some times from
> windows. However some times I commit a file from Windows(running
> tortoiseSVN and Komodo EDIT) it corrupts the script and adds ^M to the
> end of every line, often times ruining the structure of the file too.
> Is there a way to disable this or do I have to run a dos2unix script
> after every commit to remove them?

Look up "propset" and "eol-style". In particular, in the [auto-props]
section of my configuration file I have a number of lines of the form

*.c = svn:eol-style=native
*.txt = svn:eol-style=native
*.pl = svn:eol-style=native;svn:executable

I do this both in Windows and in Linux so that I don't have files with
only ^J when I check them out under Windows.

You can also add this property manually after the files are committed:

svn propset svn:eol-style=native file1 file2 ...

Since you are seeing ^M now, you will need to do this manually for the
affected files.

Other useful commands:

svn proplist file
svn propget svn:eol-style file

where "file" is the name of the file you are looking at.

     David Chapman         dcchapman_at_acm.org
     Chapman Consulting -- San Jose, CA
Received on 2011-02-23 17:35:51 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.