[Koha-devel] Proposal to Standardize Bug Number References in Commit Messages

Chris Nighswonger cnighswonger at foundations.edu
Tue Nov 15 22:35:49 CET 2011


Sorry for the pause on my part here.


2011/11/14 Ian Walls <ian.walls at bywatersolutions.com>:
> I'm afraid I'm not seeing the need to standardize the expression of bug
> number in commit messages.  We're already using "Bug XXXX" or "Enh XXXX"
> most of the time, and that's worked just fine for me in all my lookups and
> QA'ing.  Do we just need a pattern that's regex-able so we can program a
> script to automatically process the patches?
>

This is moving along in a direction I did not anticipate in my original post.

Ian, it would be great if we *only* using the notation you mention
above. But, in fact, we are not. To clarify, I quote from my earlier
response to Robin:

>>
>> Also, something that's compatible with the way 'git bz' does things
>> would be very much preferred. It uses this regex:
>> (\b[Ss]ee\s+(?:[^\s:/]+\s+){0,2})?
>> (?:(https?://[^/]+/show_bug.cgi\?id=[^&\s]+)
>>     |
>>   [Bb]ug\s+\#?(\d+))
>>
>> so, 'See: <url>' or 'Bug <number>' seem to be what it looks for.
>
> Here's my current regex (its been through several revisions):
>
> ([B|b]ug|BZ)?\s?(?<![a-z]|\.)(\d{4})[\s|:|,]
>
> This extracts the following "styles" of bug references from git log,
> each of which is unique. I have a feeling that there are some other
> styles which I have not yet caught. (I realize that it only catches 4
> digit bug numbers, but '+' causes it to pick up on other junk which
> I've yet to figure out how to avoid.)

> Bug 6905:
> Bug 5995
> 5533:
> bug 5780
> 6278
> Bug 5630,
> BZ6268
> BZ6074:

All of the eight flavors mentioned above are presently in use.

As I mentioned in an earlier post as well, \d+ "should" work, but runs
in to some problems when commit ids are included.

At any rate. The entire discussion is irrelevant if someone can come
up with a "one size fits all" regexp for every style of bug tagging
currently in use. I've made my script available and am accepting any
and all patches which improve it.

Thanks to everyone taking time to participate in this thread!

Kind Regards,
Chris


More information about the Koha-devel mailing list