Return-Path: Delivered-To: apmail-subversion-users-archive@minotaur.apache.org Received: (qmail 54328 invoked from network); 24 Feb 2011 01:49:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 01:49:33 -0000 Received: (qmail 98893 invoked by uid 500); 24 Feb 2011 01:49:33 -0000 Delivered-To: apmail-subversion-users-archive@subversion.apache.org Received: (qmail 98850 invoked by uid 500); 24 Feb 2011 01:49:32 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 98843 invoked by uid 99); 24 Feb 2011 01:49:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 01:49:32 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dcchapman@acm.org designates 64.142.16.245 as permitted sender) Received: from [64.142.16.245] (HELO a.mail.sonic.net) (64.142.16.245) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 01:49:27 +0000 Received: from [192.168.1.115] (70-36-212-24.dsl.static.sonic.net [70.36.212.24]) (authenticated bits=0) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id p1O1n3cs019444 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Wed, 23 Feb 2011 17:49:04 -0800 Message-ID: <4D65B8FE.8090908@acm.org> Date: Wed, 23 Feb 2011 17:48:46 -0800 From: David Chapman Organization: Chapman Consulting User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Nico Kadel-Garcia CC: users@subversion.apache.org Subject: Re: ^M Appends to every line? References: <4D653858.7070403@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2/23/2011 4:44 PM, Nico Kadel-Garcia wrote: > On Wed, Feb 23, 2011 at 11:39 AM, Les Mikesell 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. > > 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. My two cents (and one million lines of code) worth... -- David Chapman dcchapman@acm.org Chapman Consulting -- San Jose, CA