Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share common / useful SVN pre-commit hooks [closed]

That a user has actually entered a comment on the commit message, and that it contains a particular issue number to track.


Checking for absolute paths in various text files (i.e. VRML, XML etc). Most of the checked-in code should never have absolute paths, yet some people and tools insist on producing hard-coded stuff.


I do a word count on submit messages. They need to be 5 words or more. This has led to some comedic insults against me...


  • Check for tabs and reject the check-in.
  • Check for inconsistent line endings and reject the check-in.
  • Check for occurance of "CR: [username]" and reject the check-in if there is no code review.

You might want to take a look at: http://svn.apache.org/repos/asf/subversion/branches/1.6.x/www/tools_contrib.html#hook_scripts (This page might be outdated obviously it is not maintained anymore for Subversion 1.7)

Or directly at: https://svn.apache.org/repos/asf/subversion/trunk/contrib/