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

Re: doing a massive EOL normalization for a small group of users?

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Wed, 29 Oct 2008 19:45:10 -0500

On Oct 29, 2008, at 13:38, Robert P. J. Day wrote:

> Quoting David Weintraub:
>> As far as I can see, you'll have to do this and this will interrupt
>> everyone who is currently editing.
>> First off, add a pre-commit hook that will fail a commit if a file
>> being edited is of the right type and doesn't have the required
>> svn:eol-style property set to the correct value. I don't know if the
>> current Python pre-commit hook can do this, but I have a Perl
>> pre-commit hook that does this type of checking as well as folder
>> permission checking. Let me know if you want a copy of it.
> sure, send it along, but for the moment, i'm going to hold off
> on that as my first priority is to just get the normalization done
> and get everything sync'ed. once that's done, i can add the
> properties
> and commit hooks at my leisure to keep everything that way.

You can do that, but to be sure you got everything right, you'll have
to do the normalization twice then -- a second time after you've set
the pre-commit hook. Otherwise, someone might have committed improper
line endings to a file between the time you did your first
normalization and the time you installed the pre-commit hook.

>> After that, you'll have to do a massive checkout that will checkout
>> the entire repository, and add the svn:eol-style property to the
>> file,
>> then do a checkin. This of course, has to be coordinated with
>> everyone. Some people will be editing these same files, and will
>> get a
>> commit conflict when they attempt to check them in. But, it isn't all
>> that bad. You're not modifying the file, only the property. The
>> merge,
>> although a pain (I hate it when commits fail too) is pretty simple.
> again, adding that property is something that can be done afterwards
> to keep things clean once they've been cleaned up. my number one
> priority is to just get there, so i'm about to give it a shot. i'm
> still curious if anyone's ever actually *done* this, and the exact
> order of the steps to make it go smoothly, including what to get
> the users to do in preparation, assuming that they simply can't
> drop everything they're doing and check in all their changes.

If you have files with consistent line endings, just the wrong line
endings, you can just set svn:eol-style to native and Subversion will
convert the line endings to LF and store it in the repository.

If you have files with inconsistent line endings, Subversion will not
convert it for you.You must convert it yourself, e.g. using tr or
dos2unix or whatever. Then you can add the svn:eol-style property.

If you just clean up the files, then at some later point add the
property, it may be too late; someone may already have committed new
incorrect line endings to the file by then.

Your strategy should be to add the svn:eol-style property to files.
If it fails because of inconsistent line endings, then fix the line
endings and immediately set the svn:eol-style property so they can't
get inconsistent again.

To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-30 01:45:37 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.