Created
February 22, 2012 08:22
-
-
Save rynr/1883399 to your computer and use it in GitHub Desktop.
Ruby svn-hook to check Log for format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
repo_path = ARGV[0] | |
transaction = ARGV[1] | |
svnlook = '/usr/bin/svnlook' | |
#commit_dirs_changed = `#{svnlook} dirs-changed #{repo_path} -t #{transaction}` | |
#commit_changed = `#{svnlook} changed #{repo_path} -t #{transaction}` | |
#commit_author = `#{svnlook} author #{repo_path} -t #{transaction}`.chop | |
commit_log = `#{svnlook} log #{repo_path} -t #{transaction}` | |
#commit_diff = `#{svnlook} diff #{repo_path} -t #{transaction}` | |
#commit_date = `#{svnlook} date #{repo_path} -t #{transaction}` | |
if(commit_log !~ /^(FIX|REF|ST ?\d+) /i) | |
STDERR.puts("Sorry, need to prefix your comment with FIX, REF or ST <id>") | |
exit(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment