summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2009-02-06 09:12:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-07 20:50:49 (GMT)
commitccb04f99fe3858bae0f06fc7aeefc4d53fec1352 (patch)
treef83518c0efacf44cc518218c9e63e7f7b793abb0 /gitweb
parent621f1b4bcf40f1469fc59202248df35619e33c82 (diff)
downloadgit-ccb04f99fe3858bae0f06fc7aeefc4d53fec1352.zip
git-ccb04f99fe3858bae0f06fc7aeefc4d53fec1352.tar.gz
git-ccb04f99fe3858bae0f06fc7aeefc4d53fec1352.tar.bz2
gitweb: Better regexp for SHA-1 committag match
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>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f27dbb6..bec1af6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1364,7 +1364,7 @@ sub format_log_line_html {
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),