X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/f797305daf36d29f33de26f50998111613113784667a26d6d63680d85b81c16d..48abd01729dbca9e676c3bad94dbfa11a6a1c4c08d17392a3e1dcc3a50a57b2c:/gitweb.cgi diff --git a/gitweb.cgi b/gitweb.cgi index f153034..37997fc 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -15,7 +15,7 @@ use CGI::Carp qw(fatalsToBrowser); use Fcntl ':mode'; my $cgi = new CGI; -my $version = "150"; +my $version = "154"; my $my_url = $cgi->url(); my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; @@ -359,7 +359,7 @@ sub git_read_commit { $co{'parent'} = $parents[0]; my (@comment) = map { chomp; $_ } <$fd>; $co{'comment'} = \@comment; - $comment[0] =~ m/^(.{0,60}[^ ]*)/; + $comment[0] =~ m/^(.{0,60}[^ \/]*)/; $co{'title'} = $1; if ($comment[0] ne $co{'title'}) { $co{'title'} .= " ..."; @@ -651,39 +651,39 @@ sub git_project_list { sub git_read_refs { my $ref_dir = shift; - my @taglist; + my @reflist; opendir my $dh, "$projectroot/$project/$ref_dir"; - my @tags = grep !m/^\./, readdir $dh; + my @refs = grep !m/^\./, readdir $dh; closedir($dh); - foreach my $tag_file (@tags) { - my $tag_id = git_read_hash("$project/$ref_dir/$tag_file"); - my $type = git_get_type($tag_id) || next; - my %tag_item; + foreach my $ref_file (@refs) { + my $ref_id = git_read_hash("$project/$ref_dir/$ref_file"); + my $type = git_get_type($ref_id) || next; + my %ref_item; my %co; if ($type eq "tag") { - my %tag = git_read_tag($tag_id); + my %tag = git_read_tag($ref_id); if ($tag{'type'} eq "commit") { %co = git_read_commit($tag{'object'}); } - $tag_item{'type'} = $tag{'type'}; - $tag_item{'name'} = $tag{'name'}; - $tag_item{'id'} = $tag{'object'}; + $ref_item{'type'} = $tag{'type'}; + $ref_item{'name'} = $tag{'name'}; + $ref_item{'id'} = $tag{'object'}; } elsif ($type eq "commit"){ - %co = git_read_commit($tag_id); - $tag_item{'type'} = "commit"; - $tag_item{'name'} = $tag_file; - $tag_item{'title'} = $co{'title'}; - $tag_item{'id'} = $tag_id; + %co = git_read_commit($ref_id); + $ref_item{'type'} = "commit"; + $ref_item{'name'} = $ref_file; + $ref_item{'title'} = $co{'title'}; + $ref_item{'id'} = $ref_id; } - $tag_item{'epoch'} = $co{'author_epoch'} || 0; - $tag_item{'age'} = $co{'age_string'} || "unknown"; + $ref_item{'epoch'} = $co{'committer_epoch'} || 0; + $ref_item{'age'} = $co{'age_string'} || "unknown"; - push @taglist, \%tag_item; + push @reflist, \%ref_item; } # sort tags by age - @taglist = sort {$b->{'epoch'} <=> $a->{'epoch'}} @taglist; - return \@taglist; + @reflist = sort {$b->{'epoch'} <=> $a->{'epoch'}} @reflist; + return \@reflist; } sub git_summary { @@ -744,6 +744,10 @@ sub git_summary { print "$co{'age_string'}\n" . "$co{'author_name'}\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, escapeHTML($co{'title'})) . "\n" . + "" . + $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") . + " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") . + "\n" . ""; } else { print "" . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "...") . "\n" . @@ -1333,7 +1337,13 @@ sub git_commitdiff { my $comment = $co{'comment'}; my $empty = 0; my $signed = 0; - foreach my $line (@$comment) { + my @log = @$comment; + # remove first and empty lines after that + shift @log; + while (defined $log[0] && $log[0] eq "") { + shift @log; + } + foreach my $line (@log) { if ($line =~ m/^(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) { next; }