Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force svn:eol-style=native on the server?

Currently, in order to ensure the subversion property eol-style is set to native for each new file added to our project, we have to add this to the ~/.subversion/config file on each of our developers machines:

[miscellany]
enable-auto-props = yes

[auto-props]
*.java = svn:eol-style=native

Is there a way to do the equivalent on the svn server?

like image 566
Bart Avatar asked Apr 15 '11 01:04

Bart


1 Answers

No there is not.

You can use a hook scripts to look for the property to be set or not, but apart from that it's not possible. Subversion, differently than CVS, cannot change the content of the code coming from a commit.

The SVN book includes a note about this question:

Warning

Do not attempt to modify the transaction using hook scripts. A common example of this would be to automatically set properties such as svn:eol-style or svn:mime-type during the commit. While this might seem like a good idea, it causes problems. The main problem is that the client does not know about the change made by the hook script, and there is no way to inform the client that it is out-of-date. This inconsistency can lead to surprising and unexpected behavior.

Instead of attempting to modify the transaction, it is much better to check the transaction in the pre-commit hook and reject the commit if it does not meet the desired requirements.

like image 197
Fausto Carvalho Marques Silva Avatar answered Oct 24 '22 04:10

Fausto Carvalho Marques Silva