A while ago I blogged about my git-bz tool for Git and Bugzilla integration. If you recall, the original idea was:
git bz attach http://bugzilla.example.com/show_bug.cgi?id=43215 HEAD
But that left a gap – once you were happy with the patch, how did you close the bug? You had to go back to your web brower, and twiddle a bunch of form controls. So, I’ve now added:
git bz push
Which looks at the URL that ‘git bz attach’ added to your commit message, finds the bug from there, and pops up a prefilled editor. It looks something like:
# Bug 43215 - Split HTTP communication out of Bug class - UNCONFIRMED # http://bugzilla.example.com/show_bug.cgi?id=43215 # Enter comment on following lines; delete everything to abort Attachment 892 pushed as f319ea4 - Split HTTP communication out of Bug class # Comment to keep bug open # possible resolutions: [F]IXED, [I]NVALID, [WON]TFIX, [WOR]KSFORME Resolution: FIXED # Lines below change patch status, unless commented out # possible statuses: [n]one, [rev]iewed, [rej]ected, [c]ommitted, [o]bsolete committed @892 - Split HTTP communication out of Bug class - none
You can just accept it, or you can make changes and add additional comment text. Once you exit the editor, the bug is closed and the attachments are marked committed.
Even more recently (just today) I implemented a feature request from Benjamin Otte for:
git bz push --fix 43215
This combines ‘git bz attach’ and ‘git bz push’ into one. So, to review, what it does is:
- Rewrites the commit to include the bug URL
- Attaches the commit to the bug, and marks it ‘committed’
- Pushes the commit
- Adds a comment to the bug and mark it resolved
The only thing it doesn’t do is mail your boss and ask for a raise.
Some of the other recent activity for git-bz:
- Fixed to work with new GNOME bugzilla
- ‘git bz edit’ – like ‘git bz push’, but not tied to a push. (So, you can just use it instead of the web when convenient.)
- Customizable “URL addition” - you can have “Bug nnnn – ” on the subject line instead of an URL appended to the commit body.
- “URL addition” defaults to on, so you don’t have to remember to pass -u/–add-url
- No need to specify the bug # when re-attaching an updated version of a commit
- XML-RPC used for bug filing when available (improves error handling a bit)
- Chromium cookie-reading support (from Colin)
- Docs split out into a man page
As always, installation is trivial – just grab the script and put it somewhere in your path. (Or get the git repo URL from cgit, clone it, and symlink.)






