Subversion: Native EOL-Style without Using Auto-Props
I've found that trying to explicitly define all the possible auto-props file filters in .subversion/config can become unruly. For instance after writing a script to analyze the files for an embedded Linux kernel there were over 400 filters.
The SVN manual states that, unless the mime-type property is set and states otherwise, a file is considered human readable text.
Is there a way to wor开发者_开发技巧k with SVN such that any file without a binary mime-type will have its end-of-line style handled in a native way?
If I can do this then I need only define filters for binary files which is much easier to maintain.
After some experiments I decided to keep the config simple. I wrote a Python3/pysvn script that gives me some feedback on the assumed properties and the same script will allow me to set svn:mime-type and svn:eol-style on files. Something like:
$ find . -name *.HEX | xargs SVNProperty.py --make-text
Given a list of files or directories the same script will list all files that are either binary or contain no properties. The next time I do this I'll probably add the option to automatically add properties to files that do not have them.
精彩评论