Wireshark-dev: Re: [Wireshark-dev] do we continue to reference revision numbers?
From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Fri, 31 Jan 2014 12:46:16 -0800
On 1/31/14 8:55 AM, Peter Wu wrote:
> On Friday 31 January 2014 11:46:34 Hadriel Kaplan wrote:
>> Any specific leading character(s) we should use, so that bugzilla can
>> someday parse it and insert the appropriate url? Like ‘c[commit_id_sha1]'
> 
> I propose the regex /\bcommit [0-9a-f]{4,40}\b/i (or /[Cc]ommit .../ without i 
> modifier). "cabcdef" does not look pretty and the "commit abcdef" notation is 
> also very natural (see commit messages for Linux, bisect runs, etc.

For Bugzilla I added support for /g[0-9a-f]{4,40}/ since that's what
`git describe` generates. According to Linus 'g' was used to distinguish
from other SCMs that use hashes:

http://permalink.gmane.org/gmane.comp.version-control.git/142445

It also helps maintain regex sanity in that 'g' is not a valid hex
digit. Adding a match for "commit ..." sounds good so I've added support
for it as well.

We now have the following autolink regexes in place:

Gerrit → Bugzilla bug: (bug\s+#?)(\d+)

Gerrit → Gerrit ChangeID: (I[0-9a-f]{8,40})

Gerrit → Gerrit Git shorthand: \b(g[0-9a-f]{4,40})

Gerrit → Gerrit Git commit: \b([Cc]ommit\s+g?)([0-9a-f]{4,40})


Bugzilla → Anonsvn ViewVC:
  ( (?:r|rev \s? \#?|revision \s? \#?|svn \s? \#?) \s? (\d{1,6}) )

Bugzilla → Gerrit ChangeID: (I[0-9a-f]{8,40})

Bugzilla → Gerrit Git shorthand: \b(g[0-9a-f]{4,40})

Bugzilla → Gerrit ChangeID: \b(commit\s+g?([0-9a-f]{4,40}))


I haven't tested these extensively so if you run into issues please let
me know.