[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: Christopher D Haakinson <cdhaakin_at_us.ibm.com>
Date: Thu, 24 Feb 2011 11:02:04 -0500

OK, so I've been testing out the svn:eol-style prop and it appears to work,
but it seems like an awful lot of work for such a simple issue.

Is there something server-side I can setup to ensure that all files contain
the correct eol style?

Also I've noticed that my shell scripts are now failing with an EOF error?
Does this mean that there's a style setting for the end of file too??

|------------>
| From: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |Ryan Schmidt <subversion-2011a_at_ryandesign.com> |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |David Chapman <dcchapman_at_acm.org> |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Cc: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |Nico Kadel-Garcia <nkadel_at_gmail.com>, users_at_subversion.apache.org |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |02/23/2011 09:04 PM |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: ^M Appends to every line? |
>------------------------------------------------------------------------------------------------------------------------------------------------|

On Feb 23, 2011, at 19:48, David Chapman wrote:
> On 2/23/2011 4:44 PM, Nico Kadel-Garcia wrote:
>> On Wed, Feb 23, 2011 at 11:39 AM, Les Mikesell wrote:
>>> 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.
>
> Uh, no. Use of "svn:eol-style" avoids a world of hurt - programmers do
not have to run a script *every* time they check out a file. Requiring
users to run a script to fix line endings in every sandbox is a recipe for
disaster.
>
> "dos2unix" and "unix2dos" are precisely the kind of local rewriting you
want to avoid.

Some have the view that setting svn:eol-style to native is a problem;
perhaps that's what Nico meant. Certainly, it would be a problem (wouldn't
work as designed) if you check out a working copy on a platform with one
eol convention (e.g. Mac OS X) and move that working copy to an OS with a
different eol convention (e.g. Windows). If that is something you plan to
do, the alternative is to still use svn:eol-style but set it to a specific
eol style instead -- for example LF. Then you would have to configure all
your editors on all platforms to use that line ending style.*

* Actually it does not matter if the editor decided, for example, to
completely convert the file from, say, LF to CRLF line endings. On commit,
your Subversion client would notice the change and convert it back to just
LF before submitting it to the repository. The situation Subversion won't
handle for you, and will abort the commit with an error message, is if your
editor decides to save a file with mixed line endings. Such editors are
broken IMHO. UltraEdit is an example of an editor we used which was broken
in this way, unless you remembered to change a particular preference
setting.

NOT using svn:eol-style at all will remove all eol checks that Subversion
does, and if you are using multiple editors on multiple platforms, you will
most probably end up with files of mixed line ending styles. THAT is a
recipe for disaster.

graycol.gif ecblank.gif
Received on 2011-02-24 17:02:48 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.