One surprise in commit messages with git

Chris Rees crees at bayofrum.net
Thu Apr 22 20:07:46 UTC 2021



On 22 April 2021 20:29:42 BST, Enji Cooper <yaneurabeya at gmail.com> wrote:
>
>> On Apr 22, 2021, at 8:00 AM, Adriaan de Groot <adridg at FreeBSD.org>
>wrote:
>> 
>> There are still some surprises in the pipeline that processes
>commits. I
>> triggered one today with f365336113. In my commit message, I was
>fixing
>> something  in an earlier commit, so I wrote "(bla-di-bla, fixes)
>ports
>> 620d7678c8."
>> 
>> The commit itself refers to a PR (with the usual PR: line), 255260.
>So
>> Bugzilla automation takes over, and pastes the commit into a comment
>there. It
>> looks to me like Bugzilla takes "ports [0-9]+" in the commit message
>as an SVN
>> reference -- the message as-pasted as a comment in Bugzilla then
>surprisingly
>> - links to svnweb (which still exists)
>> - links to r620, which is 26 years old
>> 
>> Overall harmless enough, but surprising for things that
>look-like-a-revision-
>> number but are a really a prefix to a longer hash.
>
>Hi ade,
>	This probably deserves a Bugzilla bug so folks on the git@ end can
>resolve the commit message parsing issue.
>Cheers,

Unfortunately, it's not really that simple- the revision parsing is done dynamically, so if you remove that regex from Bugzilla, historical bugs with SVN references will no longer be linked.  Whether that's a big deal or not...

I would suggest instead that the regex instead be "/ports \d\d\d\d\d+/"- this would almost eliminate false positives with git, and preserve older links, assuming that the first SVN commit is indeed after 99999... which off the top of my head it definitely is!

Chris


More information about the freebsd-git mailing list