Some Git commits may start with decimal digits and not contain any obviously hexadecimal digits like [a-f]. For example, in bug 255679 comment 2 I've pasted "ports <12-digit abbreviation>" but Bugzilla automatically appended "r" then linked to https://svnweb.freebsd.org/.
Let's test more:
- ports 111198 (exists in both SVN and Git)
- ports 123456789012 (doesn't exist, too large for SVN)
I changed the priorities for links regexp. If it's a hexadecimal number 6 to 40 characters long - consider it a git revision, only numbers - SVN. There is still an overlap between SVN And git commits, like in your example, but there is no clear way to resolve it without querying repos I'm afraid.