How to avoid mixed eol-styles in a svn repository
Asked Answered
K

2

12

Is there a best practice for preventing mixed eol-styles in a subversion repository.

I know that svn:eol-style=native can be set as an auto-prop, but I would have to ensure that it was set for all committers. I'm also reluctant to do a retrospective, repository-wide change of svn:eol-style if there is a less invasive solution.

Kora answered 24/3, 2010 at 17:10 Comment(0)
L
5

You should use pre-commit hooks on server-side.

Here is a hook you need: http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/check-mime-type.pl

This hook will enforce users to set correct eol-style.

See svn documentation on how to use them.

Also, you can implement your own hook which will set eol-style automatically.

Landmeier answered 24/3, 2010 at 17:22 Comment(1)
Thanks uthark - I suspected that hooks were the answer. I'd hoped for something else since the repository isn't hosted by me but at least I'm off in the right directionKora
D
6

Note that as of SVN 1.8 you can set up auto-props for entire trees within your repository (including at the top level), which finally fixes this issue independent of client-side config.

See the following for more details:

Dearden answered 3/9, 2014 at 12:1 Comment(2)
You should specify the URL to svnbook chapter about new autoprops and svn 1.8 release notes as well.Desertion
Although I somewhat assume people can use $SEARCH_ENGINE, you are right. Fixed to be more comprehensive.Dearden
L
5

You should use pre-commit hooks on server-side.

Here is a hook you need: http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/check-mime-type.pl

This hook will enforce users to set correct eol-style.

See svn documentation on how to use them.

Also, you can implement your own hook which will set eol-style automatically.

Landmeier answered 24/3, 2010 at 17:22 Comment(1)
Thanks uthark - I suspected that hooks were the answer. I'd hoped for something else since the repository isn't hosted by me but at least I'm off in the right directionKora

© 2022 - 2024 — McMap. All rights reserved.