06.18.06

Subversion auto-props

Posted in General at 8:11 pm

If you use subversion do yourself a favor and go set up auto-props now to set svn:eol-style=native on text files. Here, I’ll even give you the link to the subversion book chapter on Automatic Property Setting. And even better yet, heres the list of file patterns I have, just to get you started.


*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.txt = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=native
*.sql = svn:eol-style=native
*.xml = svn:eol-style=native
*.java = svn:eol-style=native
*.properties = svn:eol-style=native
*.sdl = svn:eol-style=native
*.wdl = svn:eol-style=native
*.jsp = svn:eol-style=native
*.html = svn:eol-style=native
*.css = svn:eol-style=native
*.js = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
*.pl = svn:eol-style=native
*.rb = svn:eol-style=native
*.yml = svn:eol-style=native
*.rhtml = svn:eol-style=native
*.rxml = svn:eol-style=native
*.rjs = svn:eol-style=native
*.cgi = svn:eol-style=native
*.fcgi = svn:eol-style=native
*.rake = svn:eol-style=native
Rakefile = svn:eol-style=native
*.php = svn:eol-style=native

There, now that you’ve done it, let me tell you why. What you don’t want is a project to go on for years while you’re too lazy to set all the svn:eol-style properties yourself. All the while thinking it’s not a big deal and figuring that when the issue comes up someone will tell you, or be smart enough to set things up properly themselves.

Wrong.

What really happens is that one day someone will start editing your code on Windows and they will shit all over the code base with inconsisitent EOL characters. Now, I couldn’t care less if one file is different from another, but I do care when someone changes every line in the file (WTF, you didn’t notice before you comitted?) or worse, yet… use some editor that’s so assinine that it will insert CRLF only for the lines it changes. I do believe that last one is the exact definition of the completely wrong thing to do.

Signed, your friendly neighborhood schmuck who spend entirely too much time fixing 2,000 files and setting svn:eol-style on 7,000 files. Don’t be like me, don’t be lazy.

RSS feed for comments on this post · TrackBack URL

Leave a Comment