svn_bz A commit hook script for automatically adding commit comments to Bugzilla database Copyright (C) Toby Thain . All Rights Reserved. This version is for Bugzilla 3.0.4 (patch contributed by Matthew Curry, mcurry at skarven.net; thankyou!) If you need a version for Bugzilla 2.x, see the tags directory: http://www.telegraphics.com.au/svn/svn_bz/tags/ TO INSTALL 1. Copy the two files from this repository to your server. For instance, if your Subversion repositories are in /var/svn, you could check out these scripts like so: svn checkout http://www.telegraphics.com.au/svn/svn_bz/trunk /var/svn/svn_bz which would leave them in /var/svn/svn_bz 2. Customise for your environment. In post-commit script, - set the correct full path name to the Perl script according to step 1, e.g. /var/svn/svn_bz/svn_bz_append.pl - (optionally) specify a log file name, e.g. /var/svn/svn_bz/bz-commits.log In svn_bz_append.pl, - at the variable assignment 'my $SVNLOOK = ...' around line 31, set the correct path to your 'svnlook' binary (you can check this with 'which svnlook') - at the 'chdir' statement around line 39, set the correct path to your installed Bugzilla (e.g. "/var/www/localhost/htdocs/bugzilla") - examine the policy for mapping Subversion logins to Bugzilla logins, around line 62. At our site, this finds 'fred.smith@some.domain' from Subversion author 'fsmith', by searching the Bugzilla user table. You may need to change this method for your site. 3. Add the post-commit hook to the repositories with which you wish to use it. For instance, create a hard link: ln /var/svn/svn_bz/post-commit /var/svn/PROJECT/hooks where PROJECT is the repository database directory. USING To trigger the script, commit messages must somewhere include text of the form "bug 45" or "issue #12", or "bugs 9, 14, 133". The script recognises the text Bug(s) or Issue(s), case insensitively, and the bug list may be separated by commas and/or spaces. #'s are ignored. For example, "Updated help screens to fix bug 23 and bug 190." TROUBLESHOOTING If your commit messages are of the correct form above, and referring to existent bugs, try these steps. Enable a log file (see step 2 above). Use 'tail -f /var/svn/svn_bz/bz-commits.log' to watch, while making a commit. If the log file remains empty, possible causes are: - the #! path at the head of 'svn_bz_append.pl' might be wrong. Find correct path with 'which perl' (Perl must be installed on your system).