Subject: Re: [PATCHv2] gitweb: Better regexp for SHA-1 committag match

From: Jakub Narebski <[email-masked]>
Date: Sat, 7 Feb 2009 09:34:48 +0100

Junio C Hamano wrote:
> Jakub Narebski <[email-masked]> writes:
> 
> > Make SHA-1 regexp to be turned into hyperlink (SHA-1 committag)
> > to match word boundary at beginning and end.  This way we limit
> > false matches, for example 0x74a5cd01 which is hex decimal (for
> > example memory address) but not SHA-1.
> >
> > Also make sure that it is not Message-ID, which fragment just
> > looks like SHA-1 (e.g. "Message-ID: <[email-masked]>"),
> > by using zero-width negative look-ahead assertion to _not_
> > match '@' after.
> 
> Your message I am responding to is:
> 
>     Message-ID: <[email-masked]>
> 
> Does your description mean that "200902061149" would match, because the
> LAA will say "Ah, dot is not an at-sign"?

It would unfortunately falsely match... but we cannot eliminate this
case (well, at least not checking if hexnumber is followed by dot),
because of totally legitimate

   ... at commit 8457bb9e.

So even with that we would have still false matches...
-- 
Jakub Narebski
Poland