@matheusbsbs / matheus-bagliano / commits / 4df1191071
Fork 0

attach tag to the link

Signed-off-by: Kay Sievers <kay.sievers@suse.de>

Kay Sievers committed Dec 7, 2005 at 10:51 UTC 4df11910716b25bc7720ee25950c6b81734a2674
1 file changed +17 -14
gitweb.cgi
+17 -14
@@ -312,7 +312,7 @@ a.rss_logo {
312 }
313 a.rss_logo:hover { background-color:#ee5500; }
314 span.tag {
315 - padding:0px 4px; font-size:10px;
315 + padding:0px 4px; font-size:10px; font-weight:normal;
316 background-color:#ffffaa; border:1px solid; border-color:#ffffcc #ffee00 #ffee00 #ffffcc;
317 }
318 </style>
@@ -906,12 +906,13 @@ sub git_project_list {
906 }
907
908 sub read_info_ref {
909 + my $type = shift || "";
910 my %refs;
911 # 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11
912 # c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}
913 open my $fd, "$projectroot/$project/info/refs" or return;
914 while (my $line = <$fd>) {
914 - if ($line =~ m/^([0-9a-fA-F]{40})\t.*\/([^\^]+)/) {
915 + if ($line =~ m/^([0-9a-fA-F]{40})\t.*$type\/([^\^]+)/) {
916 if (defined $refs{$1}) {
917 $refs{$1} .= " / $2";
918 } else {
@@ -1047,18 +1048,19 @@ sub git_summary {
1048 }
1049 $alternate ^= 1;
1050 if ($i-- > 0) {
1051 + my $ref = "";
1052 + if (defined $refs->{$commit}) {
1053 + $ref = " <span class=\"tag\">$refs->{$commit}</span>";
1054 + }
1055 print "<td><i>$co{'age_string'}</i></td>\n" .
1056 "<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
1057 "<td>";
1058 if (length($co{'title_short'}) < length($co{'title'})) {
1059 print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
1055 - "<b>" . esc_html($co{'title_short'}) . "</b>");
1060 + "<b>" . esc_html($co{'title_short'}) . "$ref</b>");
1061 } else {
1062 print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"},
1058 - "<b>" . esc_html($co{'title'}) . "</b>");
1059 - }
1060 - if (defined $refs->{$commit}) {
1061 - print " <span class=\"tag\">$refs->{$commit}</span>";
1063 + "<b>" . esc_html($co{'title'}) . "$ref</b>");
1064 }
1065 print "</td>\n" .
1066 "<td class=\"link\">" .
@@ -2012,7 +2014,7 @@ sub git_commitdiff_plain {
2014
2015 # try to figure out the next tag after this commit
2016 my $tagname;
2015 - my $refs = read_info_ref();
2017 + my $refs = read_info_ref("tags");
2018 open $fd, "-|", "$gitbin/git-rev-list HEAD";
2019 chomp (my (@commits) = <$fd>);
2020 close $fd;
@@ -2110,7 +2112,7 @@ sub git_history {
2112 print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
2113 "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
2114 "<td>" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"}, "<b>" .
2113 - esc_html(chop_str($co{'title'}, 50)) . "</b>") . "$ref</td>\n" .
2115 + esc_html(chop_str($co{'title'}, 50)) . "$ref</b>") . "</td>\n" .
2116 "<td class=\"link\">" .
2117 $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") .
2118 " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") .
@@ -2326,6 +2328,10 @@ sub git_shortlog {
2328 my $alternate = 0;
2329 for (my $i = ($page * 100); $i <= $#revlist; $i++) {
2330 my $commit = $revlist[$i];
2331 + my $ref = "";
2332 + if (defined $refs->{$commit}) {
2333 + $ref = " <span class=\"tag\">$refs->{$commit}</span>";
2334 + }
2335 my %co = git_read_commit($commit);
2336 my %ad = date_str($co{'author_epoch'});
2337 if ($alternate) {
@@ -2339,13 +2345,10 @@ sub git_shortlog {
2345 "<td>";
2346 if (length($co{'title_short'}) < length($co{'title'})) {
2347 print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
2342 - "<b>" . esc_html($co{'title_short'}) . "</b>");
2348 + "<b>" . esc_html($co{'title_short'}) . "$ref</b>");
2349 } else {
2350 print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"},
2345 - "<b>" . esc_html($co{'title_short'}) . "</b>");
2346 - }
2347 - if (defined $refs->{$commit}) {
2348 - print " <span class=\"tag\">$refs->{$commit}</span>";
2351 + "<b>" . esc_html($co{'title_short'}) . "$ref</b>");
2352 }
2353 print "</td>\n" .
2354 "<td class=\"link\">" .