Bugzilla subcommand for Git.联动bugzilla缺陷跟踪和git版本管理。git-bz - Command line integration of git with Bugzilla .
git-bz is a tool for integrating the Git command line with the Bugzilla bug-tracking system. Operations such as attaching patches to bugs, applying patches in bugs to your current tree, and closing bugs once you ve pushed the fixes publicly can be done completely from the command line without having to go to your web browser.
Authentication for git-bz is done by reading the cookies for the Bugzilla host from your web browser. In order to do this, git-bz needs to know how to access the cookies for your web browser; git-bz currently is able to do this for Firefox, Epiphany, Galeon and Chromium on Linux.
git bz add-url <bug reference> (<commit> | <revision range>)
git bz apply [-n | --no-add-url] <bug reference>
git bz attach [-n | --no-add-url] [-e |--edit] [<bug reference>] (<commit> | <revision range>)
git bz components [<product>]
git bz edit (<bug reference> | <commit> | <revision range>)
git bz edit (--pushed | --fix <bug reference) (<commit> | <revision range>)
git bz file [-n | --no-add-url] [[<product>]/<component>] (<commit> | <revision range>)
git bz push [--fix <bug reference>] [<repository> <refspec>…]
Before getting started, you configure the default Bugzilla instance, product and component for your repository:
git config bz.default-tracker bugzilla.example.com
git config bz.default-product TiddlyWinks
git config bz.default-component AI-Engine
Someone has found a bug in your code, and filed bug 43215 in bugzilla.example.com. You ve come up with a fix for that patch locally, but you want the bug reporter to test it, so you attach the change you made locally to the bug report as a patch:
git bz attach 43215 HEAD
This automatically rewrites the commit to add the URL of the bug to the commit message for future reference. The reporter finds some problems in testing, so you come up with a new version of the change and modify your commit using git commit --amend. To attach the new version, you run:
git bz attach -e HEAD
You don t have to specify the bug number this time since git-bz will find it in the commit message. The -e option (short for --edit) allows you to edit the comment for the bug to say what you ve changed and pick patches to obsolete. Now everybody s happy with the change. To push your changes and close the bug, you run:
git bz push
This does git push, adds a comment that the commits were pushed and marks the patches committed. The changes it is making to the bug will be shown in your editor to give you a chance to confirm them and add extra comments if desired.
Other useful commands are git bz file to file a new bug rather than attaching patches to an existing one, git bz apply to apply patches from a bug to the current tree, and git bz edit to add comments to or close bug reports.