From: Giuseppe Bilotta Date: Sat, 02 Aug 2008 15:39:14 GMT Subject: [PATCH] gitweb: ref markers link to named shortlogs Message-ID: <1217691554-10407-1-git-send-email-giuseppe.bilotta@gmail.com> This patch turns ref markers for tags and heads into links to shortlog/refname. Appropriate changes are made in the CSS to prevent ref markers to be annoyingly blue and underlined. Signed-off-by: Giuseppe Bilotta --- gitweb/gitweb.css | 5 +++++ gitweb/gitweb.perl | 5 ++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index aa0eeca..2b43eea 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -481,6 +481,11 @@ span.refs span { border-color: #ffccff #ff00ee #ff00ee #ffccff; } +span.refs span a { + text-decoration: none; + color: inherit; +} + span.refs span.ref { background-color: #aaaaff; border-color: #ccccff #0033cc #0033cc #ccccff; diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 90cd99b..7f391fa 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1093,6 +1093,7 @@ sub format_log_line_html { sub format_ref_marker { my ($refs, $id) = @_; my $markers = ''; + my $htmltext; if (defined $refs->{$id}) { foreach my $ref (@{$refs->{$id}}) { @@ -1101,13 +1102,15 @@ sub format_ref_marker { if ($ref =~ m!^(.*?)s?/(.*)$!) { $type = $1; $name = $2; + $htmltext = $cgi->a({-href => href(action=>"shortlog", hash=>$name)}, $name); } else { $type = "ref"; $name = $ref; + $htmltext = esc_html($name); } $markers .= " " . - esc_html($name) . ""; + $htmltext . ""; } } -- 1.5.6.3