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

Re: Re: fixing files committed with wrong eol-style

From: David Weintraub <qazwart_at_gmail.com>
Date: Tue, 20 Jul 2010 20:44:12 -0400

On Mon, Jul 19, 2010 at 11:10 PM, Kitching, Simon
<Simon.Kitching_at_airnz.co.nz> wrote:

> On Wed, 2010-07-14 at 10:35 -0400, David Weintraub wrote:
>> I have a pre-commit hook that will verify that particular files have
>> svn:eol-style set before allowing a commit. This way, you can make
>> sure that the property is set before anyone can do a commit.

> Yes, that might be the best way to prevent the problem reoccurring in
> the future. Unfortunately, it doesn't help with fixing a pre-existing
> repository (ie setting eol:style=native on existing files that really
> should have had it set when they were created but didn't).

Here's a solution you haven't considered: Force all text files to have
"svn:eol-style" set to "CRLF" instead of "native".

I've found that Windows tends to be the system that messes up line
endings. Many developers will open up Notepad or Wordpad which will
muck up line endings if the file doesn't already have Windows style
line endings. However, Linux/Unix users tend to use tools like
Eclipse, VIM, or Emacs which will not mess with the line endings of
files that it is editing. If a file has "CRLF", these editors wont'
change it.

These Unix/Linux tools can also be configured to default to Windows'
CRLF on new files too.

Then, you simply need a hook to enforce the use of Windows line
endings on all text files (except maybe Unix specific files like Shell
scripts and Makefiles which fail if they have CRLF line endings).

-- 
David Weintraub
qazwart_at_gmail.com
Received on 2010-07-21 02:44:51 CEST

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.