[openstack-dev] [Infra] New "Bug" tags in commit messages

James E. Blair jeblair at openstack.org
Fri Aug 2 16:00:08 UTC 2013


Hi,

Anthony Dodd has recently implemented some cool new features that we
discussed at the summit -- driving more automation from commit messages.
Here's what you need to know to use the new features:

Use header style references when referencing a bug in your commit
log. The following styles are now supported and recommended [1]:

    Closes-Bug: #1234567 -- use 'Closes-Bug' if the commit is intended to
    fully fix and close the bug being referenced.

    Partial-Bug: #1234567 -- use 'Partial-Bug' if the commit is only a
    partial fix and more work is needed.

    Related-Bug: #1234567 -- use 'Related-Bug' if the commit is merely
    related to the referenced bug.

While it is perfectly fine to reference a bug at any point within your
commit log, in order for proper automation to take place, ensure that
you reference your bugs on their own line, and preferably at the bottom
of the commit log near the Change-Id header as prescribed in our wiki
[2].

The Regular Expression which we use to parse commit logs for bug
references is case-insensitive. Using the header 'closes-bug' is
identical to using 'Closes-Bug' in terms of the automation it will
affect.

If your fix spans multiple commits, then simply use the 'Partial-Bug'
header when you reference your bug. Then, when you are ready to close
the bug with a final commit, use the 'Closes-Bug' header.

If you are having a lot of difficulty remembering to use the recommended
header styles, have no fear! Referencing your bugs the old school way
still works. That is:

    bug #123454321 -- this will invoke the 'Closes-Bug' functionality.

    fixes bug: #123454321 -- this will invoke the 'Closes-Bug'
    functionality.

    resolves bug: #123454321 -- this will invoke the 'Closes-Bug'
    functionality.

    Supplying an unknown bug header—such as 'Mega-Bug: #123454321' -- will
    simply invoke the 'Related-Bug' functionality for safety reasons.

[1] For original summit discussion, see
    https://etherpad.openstack.org/drive-automation-from-commitmsg

[2] https://wiki.openstack.org/wiki/GitCommitMessages

Thanks again, Anthony, for doing this!

-Jim



More information about the OpenStack-dev mailing list