The email-to-bugzilla bug-number-matching regular expression

Joseph Myers joseph@codesourcery.com
Fri Sep 17 16:38:02 GMT 2021


Since Apr 2020, /sourceware/infra/bin/email-to-bugzilla has matched bug 
numbers with:

while ($log_txt =~ m/\s(?:bug|PR|BZ)\s+\#?\s*(?:[a-z0-9+-]+\/)?(?:\/)?(\d+)(.*)$/si) {

That is, whitespace is required before "bug", "PR" or "BZ".  That's fine 
for GCC commit conventions (bug numbers mentioned in a ChangeLog entry in 
the commit message, "PR c/123456" after a TAB).  It doesn't work very well 
for glibc commit messages (no ChangeLog entries used, bug numbers often 
mentioned only in the form "(bug 12345)" or "[BZ #12345]" in the commit 
summary line.

Could we use \b instead of \s at the start of the regular expression, so 
we still avoid matching "Apr 1", but do match "(bug" or "[BZ"?

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list