summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 621f1b4)
raw | patch | inline | side by side (parent: 621f1b4)
author | Jakub Narebski <jnareb@gmail.com> | |
Fri, 6 Feb 2009 09:12:41 +0000 (10:12 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 7 Feb 2009 20:50:49 +0000 (12:50 -0800) |
Make SHA-1 regexp to be turned into hyperlink (the SHA-1 committag)
to match word boundary at the beginning and the end. This way we
reduce number of false matches, for example we now don't match
0x74a5cd01 which is hex decimal (for example memory address),
but is not SHA-1.
Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
to match word boundary at the beginning and the end. This way we
reduce number of false matches, for example we now don't match
0x74a5cd01 which is hex decimal (for example memory address),
but is not SHA-1.
Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f27dbb6bf4acfe6f5381d7c86760b1170c8a10ff..bec1af6b73bca92fdb0cabc45bb5e41d178b9a1d 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
my $line = shift;
$line = esc_html($line, -nbsp=>1);
- if ($line =~ m/([0-9a-fA-F]{8,40})/) {
+ if ($line =~ m/\b([0-9a-fA-F]{8,40})\b/) {
my $hash_text = $1;
my $link =
$cgi->a({-href => href(action=>"object", hash=>$hash_text),