Doesn't seem to be configurable. We can of course turn that off completely, but in that case it will no longer match any other git hash references in commit messages, so that might be a net loss.
I wonder if it's worth forking gitweb to make it do explicitly what we want for this -- that is recognize all the different kinds of things that would be interesting here. But that fork should probably be done by somebody with some more perl skills than me :)