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

Re: End of the Line for Merge? [Merging and EOL Style Problem]

From: Nico Kadel-Garcia <nkadel_at_comcast.net>
Date: 2006-08-15 15:15:02 CEST

Rob Hubbard wrote:

> There is an obstacle to just going ahead and doing this. When
> svn:eol-style is changed (certainly to "LF" or "native"), SVN appears
> to store these internally as an LF. Our files are mostly
> Windows-style CR+LF. Therefore, when the property is set, every, or
> nearly every, line of those files will change. A minor problem is
> that that will effectively hide the history up to that point of all
> lines when doing an svn blame. A more serious problem is that svn
> merge will now fail properly to synchronise the two/three files, even
> if the svn:eol-style change has been performed on both branches
> concerned.

This is an old bane of source control systems, whether you use native EOL or
not. Fixing it is often a multi-step process.

1: Work out a way to force svn:eol-style going forward. You don't want this
happening again.
2: Convert every appropriate file as determined by those new policies that
should have an svn:eol-style set.
3: Use dos2unix or unix2dos or a tool like that to convert every file.
4: Commit them as changed.
5: Set every darned file to the new style.
6: Commit that.

You'll run into trouble with anyone who expects to use an NFS or SMB mounted
directory to use the same codebase for both Windows and UNIX-like systems,
or MacOS. Make people check out local copies instead of sharing. Also, make
sure that CygWin installations use *WINDOWS* end-of-line style, not UNIX
end-of-line style, or any use of Subversion from inside CygWin will
seriously muck up local copies.

> Alternatively, if the svn:eol-style properties are set on all active
> branches from the current revision, is there a way to deal better
> with merge/update - that is to merge (perhaps through a third-party
> merge program) but for merge to ignore line-ending changes?

dos2unix and unix2dos are built into most UNIX-like systems and CygWiin
these days.

> Obviously, I also need to set up everyone's config file with the
> appropriate autoprops, and perhaps write a server-side script to
> check the properties of added files, to avoid similar problems in
> future. (I gather that server-side autoprops are being considered.)
> [Another solution would be for a server-side script to check for
> consistent line endings during a commit; but I'd rather use the
> svn:eol-style mechanism.]

You really, really, really want that pre-commit going forward. Honest.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 15 15:16:35 2006

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.