1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 23:07:55 +01:00
This commit is contained in:
Kay Sievers 2005-08-07 20:24:43 +02:00
parent 0db37973ed
commit fa378499c7

View file

@ -15,7 +15,7 @@ use CGI::Carp qw(fatalsToBrowser);
use Fcntl ':mode'; use Fcntl ':mode';
my $cgi = new CGI; my $cgi = new CGI;
my $version = "150"; my $version = "152";
my $my_url = $cgi->url(); my $my_url = $cgi->url();
my $my_uri = $cgi->url(-absolute => 1); my $my_uri = $cgi->url(-absolute => 1);
my $rss_link = ""; my $rss_link = "";
@ -651,39 +651,39 @@ sub git_project_list {
sub git_read_refs { sub git_read_refs {
my $ref_dir = shift; my $ref_dir = shift;
my @taglist; my @reflist;
opendir my $dh, "$projectroot/$project/$ref_dir"; opendir my $dh, "$projectroot/$project/$ref_dir";
my @tags = grep !m/^\./, readdir $dh; my @refs = grep !m/^\./, readdir $dh;
closedir($dh); closedir($dh);
foreach my $tag_file (@tags) { foreach my $ref_file (@refs) {
my $tag_id = git_read_hash("$project/$ref_dir/$tag_file"); my $ref_id = git_read_hash("$project/$ref_dir/$ref_file");
my $type = git_get_type($tag_id) || next; my $type = git_get_type($ref_id) || next;
my %tag_item; my %ref_item;
my %co; my %co;
if ($type eq "tag") { if ($type eq "tag") {
my %tag = git_read_tag($tag_id); my %tag = git_read_tag($ref_id);
if ($tag{'type'} eq "commit") { if ($tag{'type'} eq "commit") {
%co = git_read_commit($tag{'object'}); %co = git_read_commit($tag{'object'});
} }
$tag_item{'type'} = $tag{'type'}; $ref_item{'type'} = $tag{'type'};
$tag_item{'name'} = $tag{'name'}; $ref_item{'name'} = $tag{'name'};
$tag_item{'id'} = $tag{'object'}; $ref_item{'id'} = $tag{'object'};
} elsif ($type eq "commit"){ } elsif ($type eq "commit"){
%co = git_read_commit($tag_id); %co = git_read_commit($ref_id);
$tag_item{'type'} = "commit"; $ref_item{'type'} = "commit";
$tag_item{'name'} = $tag_file; $ref_item{'name'} = $ref_file;
$tag_item{'title'} = $co{'title'}; $ref_item{'title'} = $co{'title'};
$tag_item{'id'} = $tag_id; $ref_item{'id'} = $ref_id;
} }
$tag_item{'epoch'} = $co{'author_epoch'} || 0; $ref_item{'epoch'} = $co{'committer_epoch'} || 0;
$tag_item{'age'} = $co{'age_string'} || "unknown"; $ref_item{'age'} = $co{'age_string'} || "unknown";
push @taglist, \%tag_item; push @reflist, \%ref_item;
} }
# sort tags by age # sort tags by age
@taglist = sort {$b->{'epoch'} <=> $a->{'epoch'}} @taglist; @reflist = sort {$b->{'epoch'} <=> $a->{'epoch'}} @reflist;
return \@taglist; return \@reflist;
} }
sub git_summary { sub git_summary {
@ -1333,7 +1333,12 @@ sub git_commitdiff {
my $comment = $co{'comment'}; my $comment = $co{'comment'};
my $empty = 0; my $empty = 0;
my $signed = 0; my $signed = 0;
foreach my $line (@$comment) { my @log = @$comment;
shift @log;
#while ($log[0] eq "") {
# shift @log;
#}
foreach my $line (@log) {
if ($line =~ m/^(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) { if ($line =~ m/^(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
next; next;
} }