git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: recognize six digit abbreviated SHA1

From
AMAnders Melchiorsen <mail@cup.kalibalik.dk>
Date
Jan 13, 2009, 00:04 UTC
Message-ID
<87mydw2hrb.fsf@cup.kalibalik.dk>

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
Next: Anders Melchiorsen
Message 1 of 5 in “gitweb: recognize six digit abbreviated SHA1”
  1. gitweb: recognize six digit abbreviated SHA1Anders Melchiorsen, Jan 13, 2009
  2. Anders MelchiorsenJan 13, 2009
  3. Sam VilainJan 13, 2009
  4. Junio C HamanoJan 13, 2009
  5. Sam VilainJan 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.