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?
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
orsvn: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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With