[PATCH] gitweb: recognize six digit abbreviated SHA1

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Anders Melchiorsen
Date: Monday, January 12, 2009 - 5:04 pm

This lets gitweb hightlight abbreviated hashes as produced by
git rev-parse --short.

Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
---

It seems like seven digit hashes are in vogue now. So, did I miss some
reason for keeping it at eight in this spot?


diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0ac84d1..1a7d448 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1337,7 +1337,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/([0-9a-fA-F]{7,40})/) {
 		my $hash_text = $1;
 		my $link =
 			$cgi->a({-href => href(action=>"object", hash=>$hash_text),
-- 
1.6.0.2.514.g23abd3
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] gitweb: recognize six digit abbreviated SHA1, Anders Melchiorsen, (Mon Jan 12, 5:04 pm)
Re: [PATCH] gitweb: recognize six digit abbreviated SHA1, Anders Melchiorsen, (Mon Jan 12, 5:08 pm)
Re: [PATCH] gitweb: recognize six digit abbreviated SHA1, Junio C Hamano, (Tue Jan 13, 1:26 am)