Git-bz

From GnuCash
Jump to: navigation, search

Git-bz is a Python script that lets you work with bugs in Bugzilla purely from the command line, using very git-like commands. If you’re comfortable with git, and would benefit from not having to navigate through the Bugzilla website when you need to make various changes to bugs, you might like to try out git-bz. You can:

  • create new bugs using commits in your local repo
  • attach patches to existing bugs (again using your local commits)
  • add comments to bugs
  • change bug and attachments statuses
  • and so on...

git-bz (Accessing BugZilla from Git)

The original git-bz can be found at [1]. I have a version that works on Mac OS X. In both cases you’ll need to be signed in to BugZilla in either Firefox, Google Chrome, or another supported browser. See the git-bz documentation for a full list. The way git-bz authenticates with BugZilla is by reading your browser’s cookie file and then using the authentication information stored there.

Prerequisites

Git, a supported browser (see above) and a Python installation.

Download and Install

This consists of cloning one of the above Git repositories onto your working computer and symlinking the executable git-bz Python script somewhere in your $PATH. (On Windows, you might find it easier to add the git-bz directory to your personal %PATH%.)

Setup

I set up git-bz to interact with the GnuCash Documentation ‘component’ in Gnome BugZilla by default. The commands were:

 git config bz.default-tracker bugs.gnucash.org
 git config bz.default-product GnuCash
 git config bz.default-component Documentation

You can customise to your preferred default component.

Work with Bugs

Attach a Patch to a Bug

To attach a patch to an existing bug, you have to commit the work to your local repo (but don't publish it), then (assuming the bugfix patch is the latest commit) run:

 git bz attach -e <bug-number> HEAD

git-bz will open an editor and let you type a message to send with the patch. git-bz will then overwrite the commit with a new one which includes a reference to the bug number. To attach a new version of the commit (after commit --amend, e.g.):

 git bz attach -e HEAD

git-bz remembers which bug to update.

Edit a Bug

 git bz edit <bug-number> | <commit> | <commit-range>

allows you to edit a bug or multiple bugs, one at a time, and add comments, mark as fixed, etc.

For a detailed reference see the git-bz.txt file in the git-bz repository.