From: Anders Melchiorsen <mail@cup•kalibalik.dk>
To: git@vger•kernel.org
Cc: jnareb@gmail•com, gitster@pobox•com
Subject: [PATCH] gitweb: recognize six digit abbreviated SHA1
Date: Tue, 13 Jan 2009 01:04:40 +0100 [thread overview]
Message-ID: <87mydw2hrb.fsf@cup.kalibalik.dk> (raw)
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 reply other threads:[~2009-01-13 0:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 0:04 Anders Melchiorsen [this message]
2009-01-13 0:08 ` [PATCH] gitweb: recognize six digit abbreviated SHA1 Anders Melchiorsen
2009-01-13 2:00 ` Sam Vilain
2009-01-13 8:26 ` Junio C Hamano
2009-01-14 0:33 ` Sam Vilain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mydw2hrb.fsf@cup.kalibalik.dk \
--to=mail@cup$(echo .)kalibalik.dk \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=jnareb@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox