[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: Nico Kadel-Garcia <nkadel_at_gmail.com>
Date: Wed, 23 Feb 2011 19:44:52 -0500

On Wed, Feb 23, 2011 at 11:39 AM, Les Mikesell <lesmikesell_at_gmail.com> wrote:
> On 2/23/2011 10: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?
> Long version:
> http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.advanced.props.file-portability
> Short version: set the svn:eol-style property to native on the files where
> you want subversion to manage line endings.  Your client may have a list of
> file suffixes where this would be set automatically.

But in general, avoid it. If you're in a mixed platform environment,
and you are tweaking files back and forth in end-of-line settings when
you check them out in UNIX versis checking them out in Windows, you
are in for a *world* of hurt. This is a source of enormous confusion
for programmers when it works right, on one system, but not on the
other due to local re-writing.

If you're on the UNIX or Linux sides, the "dos2unix" and "unix2dos"
utilities are available with almost every distribution. For Windows,
there are other tools, including the same tools under CygWin.
Received on 2011-02-24 01:45:22 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.