+ # try to figure out the next tag after this commit
+ my $tagname;
+ my %taghash;
+ my $tags = git_read_refs("refs/tags");
+ foreach my $entry (@$tags) {
+ my %tag = %$entry;
+ $taghash{$tag{'id'}} = $tag{'name'};
+ }
+ open $fd, "-|", "$gitbin/git-rev-list HEAD";
+ while (my $commit = <$fd>) {
+ chomp $commit;
+ if ($taghash{$commit}) {
+ $tagname = $taghash{$commit};
+ }
+ if ($commit eq $hash) {
+ last;
+ }
+ }
+ close $fd;
+
+ print $cgi->header(-type => "text/plain", -charset => 'utf-8');