Archive for the 'svn' Category

06
Sep
10

visualsvn pre-commit hook


I wanted to disable commits without messages. Here’s how I did it.

Right click the repo, and go to hooks. At the pre-commit hook, I added this line:

ruby script.rb %1 %2

and then the code to get the commit message was:


repo = ARGV[0]
txn = ARGV[1]
binary = "svnlook.exe"
message = `#{binary} log #{repo} -t #{txn}`

Afterwards, your tests can be made based on message.To fail a commit, simply exit with a return code different than 0.




Blog Stats

  • 221,316 hits