Skip to content

Instantly share code, notes, and snippets.

@rynr
Created February 22, 2012 08:22
Show Gist options
  • Save rynr/1883399 to your computer and use it in GitHub Desktop.
Save rynr/1883399 to your computer and use it in GitHub Desktop.
Ruby svn-hook to check Log for format
#!/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