]>
Lady’s Gitweb - Gitweb/blob - gitweb.cgi
eeec2ef1b0dff314b783347e88b95cfde2de1e667190a01408b419434533f4f1
3 # gitweb.pl - simple web interface to track changes in git repositories
5 # (C) 2005, Kay Sievers <kay.sievers@vrfy.org>
6 # (C) 2005, Christian Gierke <ch@gierke.de>
8 # This program is licensed under the GPL v2, or a later version
12 use CGI
qw(:standard :escapeHTML);
13 use CGI
::Util
qw(unescape);
14 use CGI
::Carp
qw(fatalsToBrowser);
19 my $my_url = $cgi->url();
20 my $my_uri = $cgi->url(-absolute
=> 1);
23 # absolute fs-path which will be prepended to the project path
24 my $projectroot = "/pub/scm";
26 # location of the git-core binaries
27 my $gitbin = "/usr/bin";
29 # location for temporary files needed for diffs
30 my $gittmp = "/tmp/gitweb";
32 # target of the home link on top of all pages
33 my $home_link = $my_uri;
35 # html text to include at home page
36 my $home_text = "indextext.html";
38 # source of projects list
39 #my $projects_list = $projectroot;
40 my $projects_list = "index/index.aux";
42 # input validation and dispatch
43 my $action = $cgi->param('a');
44 if (defined $action) {
45 if ($action =~ m/[^0-9a-zA-Z\.\-]+/) {
47 die_error
(undef, "Invalid action parameter.");
49 if ($action eq "git-logo.png") {
57 my $project = $cgi->param('p');
58 if (defined $project) {
59 if ($project =~ m/(^|\/)(|\
.|\
.\
.)($|\
/)/) {
61 die_error
(undef, "Non-canonical project parameter.");
63 if ($project =~ m/[^a-zA-Z0-9_\.\/\
-\
+\#\
~]/) {
65 die_error
(undef, "Invalid character in project parameter.");
67 if (!(-d
"$projectroot/$project")) {
69 die_error
(undef, "No such directory.");
71 if (!(-e
"$projectroot/$project/HEAD")) {
73 die_error
(undef, "No such project.");
75 $rss_link = "<link rel=\"alternate\" title=\"$project log\" href=\"$my_uri?p=$project;a=rss\" type=\"application/rss+xml\"/>";
76 $ENV{'GIT_OBJECT_DIRECTORY'} = "$projectroot/$project/objects";
77 $ENV{'SHA1_FILE_DIRECTORY'} = "$projectroot/$project/objects";
83 my $file_name = $cgi->param('f');
84 if (defined $file_name) {
85 if ($file_name =~ m/(^|\/)(|\
.|\
.\
.)($|\
/)/) {
87 die_error
(undef, "Non-canonical file parameter.");
89 if ($file_name =~ m/[^a-zA-Z0-9_\.\/\
-\
+\#\
~\
:\
!]/) {
91 die_error
(undef, "Invalid character in file parameter.");
95 my $hash = $cgi->param('h');
96 if (defined $hash && !($hash =~ m/^[0-9a-fA-F]{40}$/)) {
98 die_error
(undef, "Invalid hash parameter.");
101 my $hash_parent = $cgi->param('hp');
102 if (defined $hash_parent && !($hash_parent =~ m/^[0-9a-fA-F]{40}$/)) {
104 die_error
(undef, "Invalid hash_parent parameter.");
107 my $hash_base = $cgi->param('hb');
108 if (defined $hash_base && !($hash_base =~ m/^[0-9a-fA-F]{40}$/)) {
110 die_error
(undef, "Invalid parent hash parameter.");
113 my $time_back = $cgi->param('t');
114 if (defined $time_back) {
115 if ($time_back =~ m/^[^0-9]+$/) {
117 die_error
(undef, "Invalid time parameter.");
121 if ($action eq "summary") {
124 } elsif ($action eq "tags") {
127 } elsif ($action eq "blob") {
130 } elsif ($action eq "tree") {
133 } elsif ($action eq "rss") {
136 } elsif ($action eq "commit") {
139 } elsif ($action eq "log") {
142 } elsif ($action eq "blobdiff") {
145 } elsif ($action eq "commitdiff") {
148 } elsif ($action eq "history") {
153 die_error
(undef, "Unknown action.");
157 sub git_header_html
{
158 my $status = shift || "200 OK";
161 if (defined $project) {
162 $title .= " - $project";
163 if (defined $action) {
164 $title .= "/$action";
167 print $cgi->header(-type
=>'text/html', -charset
=> 'utf-8', -status
=> $status);
169 <?xml version="1.0" encoding="utf-8"?>
170 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
171 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
172 <!-- git web interface v$version, (C) 2005, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke <ch\@gierke.de> -->
174 <title>$title</title>
176 <style type="text/css">
177 body { font-family: sans-serif; font-size: 12px; margin:0px; border:solid #d9d8d1; border-width:1px; margin:10px; }
179 a:hover, a:visited, a:active { color:#880000; }
180 div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
181 div.page_header a:visited { color:#0000cc; }
182 div.page_header a:hover { color:#880000; }
183 div.page_nav { padding:8px; }
184 div.page_nav a:visited { color:#0000cc; }
185 div.page_path { font-weight:bold; padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px}
186 div.page_footer { height:17px; padding:4px 8px; background-color: #d9d8d1; }
187 div.page_footer_text { float:left; color:#555555; font-style:italic; }
188 div.page_body { padding:8px; }
190 display:block; padding:6px 8px;
191 font-weight:bold; background-color:#edece6; text-decoration:none; color:#000000;
193 a.title:hover { background-color: #d9d8d1; }
194 div.title_text { padding:6px 8px; border: solid #d9d8d1; border-width:0px 0px 1px; }
195 div.log_body { padding:8px 8px 8px 150px; }
196 span.age { position:relative; float:left; width:142px; font-style:italic; }
198 font-size:10px; font-family:sans-serif; font-style:normal;
199 position:relative; float:left; width:142px;
201 div.list { display:block; padding:4px 8px 2px; }
203 display:block; padding:6px 6px 4px; border:solid #d9d8d1;
204 border-width:0px 0px 1px; font-style:italic;
206 div.list a { text-decoration:none; color:#000000; }
207 div.list a:hover { color:#880000; }
209 padding:4px 8px 6px; border:solid #d9d8d1; border-width:0px 0px 1px;
210 font-family:sans-serif; font-size:10px;
212 td { padding:5px 15px 0px 0px; font-size:12px; }
213 th { padding-right:10px; font-size:12px; text-align:left; }
214 td.link { font-family:sans-serif; font-size:10px; }
215 td.pre { font-family:monospace; font-size:12px; white-space:pre; padding:2px 15px 0px 0px; }
216 div.pre { font-family:monospace; font-size:12px; white-space:pre; }
217 div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
218 div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
219 a.rss_logo { float:right; padding:3px 0px; width:35px; line-height:10px;
220 border:1px solid; border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e;
221 color:#ffffff; background-color:#ff6600;
222 font-weight:bold; font-family:sans-serif; font-size:10px;
223 text-align:center; text-decoration:none;
225 a.rss_logo:hover { background-color:#ee5500; }
230 print "<div class=\"page_header\">\n" .
231 "<a href=\"http://kernel.org/pub/software/scm/git/docs/\">" .
232 "<img src=\"$my_uri?a=git-logo.png\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/></a>";
233 print $cgi->a({-href
=> $home_link}, "projects") . " / ";
234 if (defined $project) {
235 print $cgi->a({-href
=> "$my_uri?p=$project;a=summary"}, escapeHTML
($project));
236 if (defined $action) {
243 sub git_footer_html
{
244 print "<div class=\"page_footer\">\n";
245 if (defined $project) {
246 my $descr = git_read_description
($project);
247 if (defined $descr) {
248 print "<div class=\"page_footer_text\">" . escapeHTML
($descr) . "</div>\n";
250 print $cgi->a({-href
=> "$my_uri?p=$project;a=rss", -class => "rss_logo"}, "RSS") . "\n";
258 my $status = shift || "403 Forbidden";
259 my $error = shift || "Malformed query, file missing or permission denied";
261 git_header_html
($status);
262 print "<div class=\"page_body\">\n" .
264 print "$status - $error\n";
265 print "<br/></div>\n";
273 open my $fd, "-|", "$gitbin/git-cat-file -t $hash" || return;
283 open my $fd, "$projectroot/$path" || return undef;
287 if ($head =~ m/^[0-9a-fA-F]{40}$/) {
292 sub git_read_description
{
295 open my $fd, "$projectroot/$path/description" || return undef;
306 open my $fd, "-|", "$gitbin/git-cat-file tag $tag_id" || return;
307 while (my $line = <$fd>) {
309 if ($line =~ m/^object ([0-9a-fA-F]{40})$/) {
311 } elsif ($line =~ m/^type (.*)$/) {
313 } elsif ($line =~ m/^tag (.*)$/) {
318 if (!defined $tag{'name'}) {
324 sub git_read_commit
{
329 open my $fd, "-|", "$gitbin/git-cat-file commit $commit" || return;
330 while (my $line = <$fd>) {
331 last if $line eq "\n";
333 if ($line =~ m/^tree (.*)$/) {
335 } elsif ($line =~ m/^parent (.*)$/) {
337 } elsif ($line =~ m/^author (.*) ([0-9]+) (.*)$/) {
339 $co{'author_epoch'} = $2;
340 $co{'author_tz'} = $3;
341 $co{'author_name'} = $co{'author'};
342 $co{'author_name'} =~ s/ <.*//;
343 } elsif ($line =~ m/^committer (.*) ([0-9]+) (.*)$/) {
344 $co{'committer'} = $1;
345 $co{'committer_epoch'} = $2;
346 $co{'committer_tz'} = $3;
347 $co{'committer_name'} = $co{'committer'};
348 $co{'committer_name'} =~ s/ <.*//;
351 if (!defined $co{'tree'}) {
355 $co{'parents'} = \
@parents;
356 $co{'parent'} = $parents[0];
357 my (@comment) = map { chomp; $_ } <$fd>;
358 $co{'comment'} = \
@comment;
359 $comment[0] =~ m/^(.{0,60}[^ ]*)/;
361 if ($comment[0] ne $co{'title'}) {
362 $co{'title'} .= " ...";
366 my $age = time - $co{'committer_epoch'};
368 if ($age > 60*60*24*365*2) {
369 $co{'age_string'} = (int $age/60/60/24/365);
370 $co{'age_string'} .= " years ago";
371 } elsif ($age > 60*60*24*(365/12)*2) {
372 $co{'age_string'} = int $age/60/60/24/(365/12);
373 $co{'age_string'} .= " months ago";
374 } elsif ($age > 60*60*24*7*2) {
375 $co{'age_string'} = int $age/60/60/24/7;
376 $co{'age_string'} .= " weeks ago";
377 } elsif ($age > 60*60*24*2) {
378 $co{'age_string'} = int $age/60/60/24;
379 $co{'age_string'} .= " days ago";
380 } elsif ($age > 60*60*2) {
381 $co{'age_string'} = int $age/60/60;
382 $co{'age_string'} .= " hours ago";
383 } elsif ($age > 60*2) {
384 $co{'age_string'} = int $age/60;
385 $co{'age_string'} .= " minutes ago";
387 $co{'age_string'} = int $age;
388 $co{'age_string'} .= " seconds ago";
390 $co{'age_string'} .= " right now";
397 my $from_name = shift;
401 my $from_tmp = "/dev/null";
402 my $to_tmp = "/dev/null";
405 # create tmp from-file
407 $from_tmp = "$gittmp/gitweb_" . $$ . "_from";
408 open my $fd2, "> $from_tmp";
409 open my $fd, "-|", "$gitbin/git-cat-file blob $from";
418 $to_tmp = "$gittmp/gitweb_" . $$ . "_to";
419 open my $fd2, "> $to_tmp";
420 open my $fd, "-|", "$gitbin/git-cat-file blob $to";
427 open my $fd, "-|", "/usr/bin/diff -u -p -L $from_name -L $to_name $from_tmp $to_tmp";
428 while (my $line = <$fd>) {
430 my $char = substr($line, 0, 1);
433 $color = " style=\"color:#008800;\"";
434 } elsif ($char eq '-') {
435 $color = " style=\"color:#cc0000;\"";
436 } elsif ($char eq '@') {
437 $color = " style=\"color:#990099;\"";
438 } elsif ($char eq '\\') {
442 print "<div class=\"pre\"$color>" . escapeHTML
($line) . "</div>\n";
455 my $mode = oct shift;
457 if (S_ISDIR
($mode & S_IFMT
)) {
459 } elsif (S_ISLNK
($mode)) {
461 } elsif (S_ISREG
($mode)) {
462 # git cares only about the executable bit
463 if ($mode & S_IXUSR
) {
474 my $mode = oct shift;
476 if (S_ISDIR
($mode & S_IFMT
)) {
478 } elsif (S_ISLNK
($mode)) {
480 } elsif (S_ISREG
($mode)) {
489 my $tz = shift || "-0000";
492 my @months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
493 my @days = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
494 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime($epoch);
495 $date{'hour'} = $hour;
496 $date{'minute'} = $min;
497 $date{'mday'} = $mday;
498 $date{'day'} = $days[$wday];
499 $date{'month'} = $months[$mon];
500 $date{'rfc2822'} = sprintf "%s, %d %s %4d %02d:%02d:%02d +0000", $days[$wday], $mday, $months[$mon], 1900+$year, $hour ,$min, $sec;
501 $date{'mday-time'} = sprintf "%d %s %02d:%02d", $mday, $months[$mon], $hour ,$min;
503 $tz =~ m/^([+\-][0-9][0-9])([0-9][0-9])$/;
504 my $local = $epoch + ((int $1 + ($2/60)) * 3600);
505 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime($local);
506 $date{'hour_local'} = $hour;
507 $date{'minute_local'} = $min;
508 $date{'tz_local'} = $tz;
512 # git-logo (cached in browser for one day)
514 print $cgi->header(-type
=> 'image/png', -expires
=> '+1d');
515 # cat git-logo.png | hexdump -e '16/1 " %02x" "\n"' | sed 's/ /\\x/g'
516 print "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" .
517 "\x00\x00\x00\x48\x00\x00\x00\x1b\x04\x03\x00\x00\x00\x2d\xd9\xd4" .
518 "\x2d\x00\x00\x00\x18\x50\x4c\x54\x45\xff\xff\xff\x60\x60\x5d\xb0" .
519 "\xaf\xaa\x00\x80\x00\xce\xcd\xc7\xc0\x00\x00\xe8\xe8\xe6\xf7\xf7" .
520 "\xf6\x95\x0c\xa7\x47\x00\x00\x00\x73\x49\x44\x41\x54\x28\xcf\x63" .
521 "\x48\x67\x20\x04\x4a\x5c\x18\x0a\x08\x2a\x62\x53\x61\x20\x02\x08" .
522 "\x0d\x69\x45\xac\xa1\xa1\x01\x30\x0c\x93\x60\x36\x26\x52\x91\xb1" .
523 "\x01\x11\xd6\xe1\x55\x64\x6c\x6c\xcc\x6c\x6c\x0c\xa2\x0c\x70\x2a" .
524 "\x62\x06\x2a\xc1\x62\x1d\xb3\x01\x02\x53\xa4\x08\xe8\x00\x03\x18" .
525 "\x26\x56\x11\xd4\xe1\x20\x97\x1b\xe0\xb4\x0e\x35\x24\x71\x29\x82" .
526 "\x99\x30\xb8\x93\x0a\x11\xb9\x45\x88\xc1\x8d\xa0\xa2\x44\x21\x06" .
527 "\x27\x41\x82\x40\x85\xc1\x45\x89\x20\x70\x01\x00\xa4\x3d\x21\xc5" .
528 "\x12\x1c\x9a\xfe\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82";
534 my ($dev, $ino, $mode, $nlink, $st_uid, $st_gid, $rdev, $size) = stat($path);
535 my ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwuid($st_uid);
536 if (!defined $gcos) {
540 $owner =~ s/[,;].*$//;
544 sub git_project_list
{
547 if (-d
$projects_list) {
548 # search in directory
549 my $dir = $projects_list;
550 opendir my $dh, $dir || return undef;
551 while (my $dir = readdir($dh)) {
552 if (-e
"$projectroot/$dir/HEAD") {
560 } elsif (-f
$projects_list) {
562 # 'git/git.git:Linus Torvalds'
563 # 'linux/hotplug/udev.git'
564 open my $fd , $projects_list || return undef;
565 while (my $line = <$fd>) {
567 my ($path, $owner) = split ' ', $line;
568 $path = unescape
($path);
569 $owner = unescape
($owner);
570 if (!defined $path) {
573 if (-e
"$projectroot/$path/HEAD") {
585 die_error
(undef, "No project found.");
587 @list = sort {$a->{'path'} cmp $b->{'path'}} @list;
591 print "<div class=\"index_include\">\n";
592 open (my $fd, $home_text);
597 print "<div class=\"page_body\"><br/>\n" .
598 "<table cellspacing=\"0\">\n" .
600 "<th>Project</th>\n" .
601 "<th>Description</th>\n" .
603 "<th>last change</th>\n" .
606 foreach my $pr (@list) {
608 my $head = git_read_hash
("$proj{'path'}/HEAD");
609 if (!defined $head) {
612 $ENV{'GIT_OBJECT_DIRECTORY'} = "$projectroot/$proj{'path'}/objects";
613 $ENV{'SHA1_FILE_DIRECTORY'} = "$projectroot/$proj{'path'}/objects";
614 my %co = git_read_commit
($head);
618 my $descr = git_read_description
($proj{'path'}) || "";
619 # get directory owner if not already specified
620 if (!defined $proj{'owner'}) {
621 $proj{'owner'} = get_file_owner
("$projectroot/$proj{'path'}") || "";
624 "<td>" . $cgi->a({-href
=> "$my_uri?p=$proj{'path'};a=summary"}, escapeHTML
($proj{'path'})) . "</td>\n" .
625 "<td>$descr</td>\n" .
626 "<td><i>$proj{'owner'}</i></td>\n";
628 if ($co{'age'} < 60*60*2) {
629 $colored_age = "<span style =\"color: #009900;\"><b><i>$co{'age_string'}</i></b></span>";
630 } elsif ($co{'age'} < 60*60*24*2) {
631 $colored_age = "<span style =\"color: #009900;\"><i>$co{'age_string'}</i></span>";
633 $colored_age = "<i>$co{'age_string'}</i>";
635 print "<td>$colored_age</td>\n" .
636 "<td class=\"link\">" .
637 $cgi->a({-href
=> "$my_uri?p=$proj{'path'};a=summary"}, "summary") .
638 " | " . $cgi->a({-href
=> "$my_uri?p=$proj{'path'};a=log"}, "log") .
639 " | " . $cgi->a({-href
=> "$my_uri?p=$proj{'path'};a=tree"}, "tree") .
652 opendir my $dh, "$projectroot/$project/refs/tags";
653 my @tags = grep !m/^\./, readdir $dh;
655 foreach my $tag_file (@tags) {
656 my $tag_id = git_read_hash
("$project/refs/tags/$tag_file");
657 my $type = git_get_type
($tag_id) || next;
660 if ($type eq "tag") {
661 my %tag = git_read_tag
($tag_id);
662 if ($tag{'type'} eq "commit") {
663 %co = git_read_commit
($tag{'object'});
665 $tag_item{'type'} = $tag{'type'};
666 $tag_item{'name'} = $tag{'name'};
667 $tag_item{'id'} = $tag{'object'};
668 } elsif ($type eq "commit"){
669 %co = git_read_commit
($tag_id);
670 $tag_item{'type'} = "commit";
671 $tag_item{'name'} = $tag_file;
672 $tag_item{'id'} = $tag_id;
674 $tag_item{'epoch'} = $co{'author_epoch'} || 0;
675 $tag_item{'age'} = $co{'age_string'} || "unknown";
677 push @taglist, \
%tag_item;
680 @taglist = sort {$b->{'epoch'} <=> $a->{'epoch'}} @taglist;
685 my $descr = git_read_description
($project) || "none";
686 my $head = git_read_hash
("$project/HEAD");
687 $ENV{'GIT_OBJECT_DIRECTORY'} = "$projectroot/$project/objects";
688 $ENV{'SHA1_FILE_DIRECTORY'} = "$projectroot/$project/objects";
689 my %co = git_read_commit
($head);
690 my %cd = date_str
($co{'committer_epoch'}, $co{'committer_tz'});
693 if (-f
$projects_list) {
694 open (my $fd , $projects_list);
695 while (my $line = <$fd>) {
697 my ($pr, $ow) = split ' ', $line;
700 if ($pr eq $project) {
707 if (!defined $owner) {
708 $owner = get_file_owner
("$projectroot/$project");
712 print "<div class=\"page_nav\">\n" .
713 $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "log") .
714 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree"}, "tree") .
717 print "<div class=\"title\">project</div>\n";
718 print "<div class=\"page_body\">\n" .
719 "<table cellspacing=\"0\">\n" .
720 "<tr><td>description</td><td>" . escapeHTML
($descr) . "</td></tr>\n" .
721 "<tr><td>owner</td><td>$owner</td></tr>\n" .
722 "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n" .
725 open my $fd, "-|", "$gitbin/git-rev-list --max-count=11 " . git_read_hash
("$project/HEAD") || die_error
(undef, "Open failed.");
726 my (@revlist) = map { chomp; $_ } <$fd>;
729 $cgi->a({-href
=> "$my_uri?p=$project;a=log", -class => "title"}, "recent commits") .
732 print "<div class=\"page_body\">\n" .
733 "<table cellspacing=\"0\">\n";
734 foreach my $commit (@revlist) {
735 my %co = git_read_commit
($commit);
736 my %ad = date_str
($co{'author_epoch'});
739 print "<td>$co{'age_string'}</td>\n" .
740 "<td>$co{'author_name'}</td>\n" .
741 "<td>" . $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$commit"}, escapeHTML
($co{'title'})) . "</td>\n" .
744 print "<td>" . $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "...") . "</td>\n" .
752 my $taglist = git_read_tags
();
753 if (defined @$taglist) {
755 $cgi->a({-href
=> "$my_uri?p=$project;a=tags", -class => "title"}, "recent tags") .
758 print "<div class=\"page_body\">\n" .
759 "<table cellspacing=\"0\">\n";
760 foreach my $entry (@$taglist) {
764 print "<td>$tag{'age'}</td>\n" .
765 "<td>" . $cgi->a({-href
=> "$my_uri?p=$project;a=$tag{'type'};h=$tag{'id'}"}, escapeHTML
($tag{'name'})) . "</td>\n" .
768 print "<td>" . $cgi->a({-href
=> "$my_uri?p=$project;a=tags"}, "...") . "</td>\n" .
780 my $head = git_read_hash
("$project/HEAD");
782 print "<div class=\"page_nav\">\n" .
783 $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "log") .
784 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
785 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree"}, "tree") .
788 my $taglist = git_read_tags
();
790 $cgi->a({-href
=> "$my_uri?p=$project;a=summary", -class => "title"}, "tags") .
792 if (defined @$taglist) {
793 foreach my $entry (@$taglist) {
795 print "<div class=\"list\">\n" .
796 $cgi->a({-href
=> "$my_uri?p=$project;a=$tag{'type'};h=$tag{'id'}"},
797 "<span class=\"age\">$tag{'age'}</span>" . escapeHTML
($tag{'name'})) . "\n" .
801 print "<div class=\"list\"><br/></div>\n";
805 sub git_get_hash_by_path
{
810 my @parts = split '/', $path;
811 while (my $part = shift @parts) {
812 open my $fd, "-|", "$gitbin/git-ls-tree $tree" || die_error
(undef, "Open git-ls-tree failed.");
813 my (@entries) = map { chomp; $_ } <$fd>;
814 close $fd || return undef;
815 foreach my $line (@entries) {
816 #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
817 $line =~ m/^([0-9]+)\t(.*)\t(.*)\t(.*)$/;
822 if ($t_name eq $part) {
826 if ($t_type eq "tree") {
836 if (!defined $hash && defined $file_name) {
837 my $base = $hash_base || git_read_hash
("$project/HEAD");
838 $hash = git_get_hash_by_path
($base, $file_name, "blob");
840 open my $fd, "-|", "$gitbin/git-cat-file blob $hash" || die_error
(undef, "Open failed.");
841 my $base = $file_name || "";
843 if (defined $hash_base && (my %co = git_read_commit
($hash_base))) {
844 print "<div class=\"page_nav\">\n" .
845 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
846 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
847 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base"}, "tree");
848 if (defined $file_name) {
849 print " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=history;h=$hash_base;f=$file_name"}, "history");
851 print "<br/><br/>\n" .
854 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML
($co{'title'})) .
857 print "<div class=\"page_nav\">\n" .
858 "<br/><br/></div>\n" .
859 "<div class=\"title\">$hash</div>\n";
861 if (defined $file_name) {
862 print "<div class=\"page_path\">/$file_name</div>\n";
864 print "<div class=\"page_body\">\n";
866 while (my $line = <$fd>) {
869 print "<div class=\"pre\">";
870 printf "<span style=\"color:#999999;\">%4i</span>", $nr;
871 print " " .escapeHTML
($line) . "</div>\n";
873 close $fd || print "Reading blob failed.\n";
879 if (!defined $hash) {
880 $hash = git_read_hash
("$project/HEAD");
881 if (defined $file_name) {
882 my $base = $hash_base || git_read_hash
("$project/HEAD");
883 $hash = git_get_hash_by_path
($base, $file_name, "tree");
886 if (!defined $hash_base) {
887 $hash_base = git_read_hash
("$project/HEAD");
889 open my $fd, "-|", "$gitbin/git-ls-tree $hash" || die_error
(undef, "Open git-ls-tree failed.");
890 my (@entries) = map { chomp; $_ } <$fd>;
891 close $fd || die_error
(undef, "Reading tree failed.");
897 if (defined $hash_base && (my %co = git_read_commit
($hash_base))) {
898 $base_key = ";hb=$hash_base";
899 print "<div class=\"page_nav\">\n" .
900 $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "log") .
901 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
902 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
903 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base"}, "tree") .
907 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML
($co{'title'})) . "\n" .
910 print "<div class=\"page_nav\">\n";
911 print "<br/><br/></div>\n";
912 print "<div class=\"title\">$hash</div>\n";
914 if (defined $file_name) {
915 $base = "$file_name/";
916 print "<div class=\"page_path\">/$file_name</div>\n";
918 print "<div class=\"page_path\">/</div>\n";
920 print "<div class=\"page_body\">\n";
921 print "<table cellspacing=\"0\">\n";
922 foreach my $line (@entries) {
923 #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
924 $line =~ m/^([0-9]+)\t(.*)\t(.*)\t(.*)$/;
929 $file_key = ";f=$base$t_name";
931 "<td class=\"pre\">" . mode_str
($t_mode) . "</td>\n";
932 if ($t_type eq "blob") {
933 print "<td class=\"pre\">$t_name</td>\n";
934 print "<td class=\"link\">" .
935 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$t_hash" . $base_key . $file_key}, "blob") .
936 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=history;h=$hash_base" . $file_key}, "history") .
938 } elsif ($t_type eq "tree") {
939 print "<td class=\"pre\">" .
940 $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$t_hash" . $base_key . $file_key}, $t_name) .
951 open my $fd, "-|", "$gitbin/git-rev-list --max-count=20 " . git_read_hash
("$project/HEAD") || die_error
(undef, "Open failed.");
952 my (@revlist) = map { chomp; $_ } <$fd>;
953 close $fd || die_error
(undef, "Reading rev-list failed.");
955 print $cgi->header(-type
=> 'text/xml', -charset
=> 'utf-8');
956 print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
957 "<rss version=\"0.91\">\n";
959 print "<title>$project</title>\n".
960 "<link> $my_url/$project/log</link>\n".
961 "<description>$project log</description>\n".
962 "<language>en</language>\n";
964 foreach my $commit (@revlist) {
965 my %co = git_read_commit
($commit);
966 my %ad = date_str
($co{'author_epoch'});
968 "\t<title>" . sprintf("%d %s %02d:%02d", $ad{'mday'}, $ad{'month'}, $ad{'hour'}, $ad{'minute'}) . " - " . escapeHTML
($co{'title'}) . "</title>\n" .
969 "\t<link> $my_url?p=$project;a=commit;h=$commit</link>\n" .
971 my $comment = $co{'comment'};
972 foreach my $line (@$comment) {
973 print escapeHTML
($line) . "<br/>\n";
975 print "\t</description>\n" .
978 print "</channel></rss>";
982 my $head = git_read_hash
("$project/HEAD");
983 my $limit_option = "";
984 if (!defined $time_back) {
985 $limit_option = "--max-count=10";
986 } elsif ($time_back > 0) {
987 my $date = time - $time_back*24*60*60;
988 $limit_option = "--max-age=$date";
990 open my $fd, "-|", "$gitbin/git-rev-list $limit_option $head" || die_error
(undef, "Open failed.");
991 my (@revlist) = map { chomp; $_ } <$fd>;
992 close $fd || die_error
(undef, "Reading rev-list failed.");
995 print "<div class=\"page_nav\">\n";
996 print $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "last 10") . " | " .
997 $cgi->a({-href
=> "$my_uri?p=$project;a=log;t=1"}, "day") . " | " .
998 $cgi->a({-href
=> "$my_uri?p=$project;a=log;t=7"}, "week") . " | " .
999 $cgi->a({-href
=> "$my_uri?p=$project;a=log;t=31"}, "month") . " | " .
1000 $cgi->a({-href
=> "$my_uri?p=$project;a=log;t=365"}, "year") . " | " .
1001 $cgi->a({-href
=> "$my_uri?p=$project;a=log;t=0"}, "all") . "<br/>\n";
1006 my %co = git_read_commit
($head);
1007 print "<div class=\"page_body\"> Last change $co{'age_string'}.<br/><br/></div>\n";
1010 foreach my $commit (@revlist) {
1011 my %co = git_read_commit
($commit);
1013 my %ad = date_str
($co{'author_epoch'});
1015 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$commit", -class => "title"},
1016 "<span class=\"age\">$co{'age_string'}</span>" . escapeHTML
($co{'title'})) . "\n" .
1018 print "<div class=\"title_text\">\n" .
1019 "<div class=\"log_link\">\n" .
1020 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
1021 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .
1024 "<i>" . escapeHTML
($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .
1026 "<div class=\"log_body\">\n";
1027 my $comment = $co{'comment'};
1029 foreach my $line (@$comment) {
1030 if ($line =~ m/^(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
1041 print escapeHTML
($line) . "<br/>\n";
1052 my %co = git_read_commit
($hash);
1054 die_error
(undef, "Unknown commit object.");
1056 my %ad = date_str
($co{'author_epoch'}, $co{'author_tz'});
1057 my %cd = date_str
($co{'committer_epoch'}, $co{'committer_tz'});
1060 if (defined $co{'parent'}) {
1061 open my $fd, "-|", "$gitbin/git-diff-tree -r $co{'parent'} $hash" || die_error
(undef, "Open failed.");
1062 @difftree = map { chomp; $_ } <$fd>;
1063 close $fd || die_error
(undef, "Reading diff-tree failed.");
1065 # fake git-diff-tree output for initial revision
1066 open my $fd, "-|", "$gitbin/git-ls-tree -r $hash" || die_error
(undef, "Open failed.");
1067 @difftree = map { chomp; "+" . $_ } <$fd>;
1068 close $fd || die_error
(undef, "Reading ls-tree failed.");
1071 print "<div class=\"page_nav\">\n" .
1072 $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "log") .
1073 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash"}, "commit");
1074 if (defined $co{'parent'}) {
1075 print " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff");
1077 print " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") . "\n" .
1078 "<br/><br/></div>\n";
1079 if (defined $co{'parent'}) {
1081 $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash", -class => "title"}, escapeHTML
($co{'title'})) . "\n" .
1085 $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash", -class => "title"}, escapeHTML
($co{'title'})) . "\n" .
1088 print "<div class=\"title_text\">\n" .
1089 "<table cellspacing=\"0\">\n";
1090 print "<tr><td>author</td><td>" . escapeHTML
($co{'author'}) . "</td></tr>\n".
1091 "<tr><td></td><td> $ad{'rfc2822'}";
1092 if ($ad{'hour_local'} < 6) {
1093 printf(" (<span style=\"color: #cc0000;\">%02d:%02d</span> %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
1095 printf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
1097 print "</td></tr>\n";
1098 print "<tr><td>committer</td><td>" . escapeHTML
($co{'committer'}) . "</td></tr>\n";
1099 print "<tr><td></td><td> $cd{'rfc2822'}" . sprintf(" (%02d:%02d %s)", $cd{'hour_local'}, $cd{'minute_local'}, $cd{'tz_local'}) . "</td></tr>\n";
1100 print "<tr><td>commit</td><td style=\"font-family: monospace;\">$hash</td></tr>\n";
1101 print "<tr><td>tree</td><td style=\"font-family: monospace;\">" .
1102 $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, $co{'tree'}) . "</td></tr>\n";
1103 my $parents = $co{'parents'};
1104 foreach my $par (@$parents) {
1105 print "<tr><td>parent</td><td style=\"font-family: monospace;\">" .
1106 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$par"}, $par) . "</td></tr>\n";
1110 print "<div class=\"page_body\">\n";
1111 my $comment = $co{'comment'};
1114 foreach my $line (@$comment) {
1115 # print only one empty line
1117 if ($empty || $signed) {
1124 if ($line =~ m/^(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
1126 print "<span style=\"color: #888888\">" . escapeHTML
($line) . "</span><br/>\n";
1129 print escapeHTML
($line) . "<br/>\n";
1133 print "<div class=\"list_head\">\n";
1134 if ($#difftree > 10) {
1135 print(($#difftree + 1) . " files changed:\n");
1138 foreach my $line (@difftree) {
1139 # '*100644->100644 blob 9f91a116d91926df3ba936a80f020a6ab1084d2b->bb90a0c3a91eb52020d0db0e8b4f94d30e02d596 net/ipv4/route.c'
1140 # '+100644 blob 4a83ab6cd565d21ab0385bac6643826b83c2fcd4 arch/arm/lib/bitops.h'
1141 # '*100664->100644 blob b1a8e3dd5556b61dd771d32307c6ee5d7150fa43->b1a8e3dd5556b61dd771d32307c6ee5d7150fa43 show-files.c'
1142 # '*100664->100644 blob d08e895238bac36d8220586fdc28c27e1a7a76d3->d08e895238bac36d8220586fdc28c27e1a7a76d3 update-cache.c'
1143 $line =~ m/^(.)(.*)\t(.*)\t(.*)\t(.*)$/;
1149 if ($type eq "blob") {
1152 if (S_ISREG
(oct $mode)) {
1153 $mode_chng = sprintf(" with mode: %04o", (oct $mode) & 0777);
1155 print "<div class=\"list\">\n" .
1156 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$id;hb=$hash;f=$file"},
1157 escapeHTML
($file) . " <span style=\"color: #008000;\">[new " . file_type
($mode) . "$mode_chng]</span>") . "\n" .
1159 print "<div class=\"list_link\">\n" .
1160 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$id;hb=$hash;f=$file"}, "blob") . "\n" .
1162 } elsif ($op eq "-") {
1163 print "<div class=\"list\">\n" .
1164 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$id;hb=$hash;f=$file"},
1165 escapeHTML
($file) . " <span style=\"color: #c00000;\">[deleted " . file_type
($mode) . "]</span>") . "\n" .
1167 print "<div class=\"list_link\">\n" .
1168 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$id;hb=$hash;f=$file"}, "blob") . " | " .
1169 $cgi->a({-href
=> "$my_uri?p=$project;a=history;h=$hash;f=$file"}, "history") . "\n" .
1171 } elsif ($op eq "*") {
1172 $id =~ m/([0-9a-fA-F]+)->([0-9a-fA-F]+)/;
1175 $mode =~ m/^([0-7]{6})->([0-7]{6})$/;
1178 my $mode_chnge = "";
1179 if ($from_mode != $to_mode) {
1180 $mode_chnge = " <span style=\"color: #777777;\">[changed";
1181 if (((oct $from_mode) & S_IFMT
) != ((oct $to_mode) & S_IFMT
)) {
1182 $mode_chnge .= " from " . file_type
($from_mode) . " to " . file_type
($to_mode);
1184 if (((oct $from_mode) & 0777) != ((oct $to_mode) & 0777)) {
1185 if (S_ISREG
($from_mode) && S_ISREG
($to_mode)) {
1186 $mode_chnge .= sprintf(" mode: %04o->%04o", (oct $from_mode) & 0777, (oct $to_mode) & 0777);
1187 } elsif (S_ISREG
($to_mode)) {
1188 $mode_chnge .= sprintf(" mode: %04o", (oct $to_mode) & 0777);
1191 $mode_chnge .= "]</span>\n";
1193 print "<div class=\"list\">\n";
1194 if ($to_id ne $from_id) {
1195 print $cgi->a({-href
=> "$my_uri?p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$file"},
1196 escapeHTML
($file) . $mode_chnge) . "\n" .
1199 print $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$file"},
1200 escapeHTML
($file) . $mode_chnge) . "\n" .
1203 print "<div class=\"list_link\">\n";
1204 if ($to_id ne $from_id) {
1205 print $cgi->a({-href
=> "$my_uri?p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$file"}, "diff") . " | ";
1207 print $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$file"}, "blob") . " | " .
1208 $cgi->a({-href
=> "$my_uri?p=$project;a=history;h=$hash;f=$file"}, "history") . "\n" .
1217 mkdir($gittmp, 0700);
1219 if (defined $hash_base && (my %co = git_read_commit
($hash_base))) {
1220 print "<div class=\"page_nav\">\n" .
1221 $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "log") .
1222 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
1223 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
1224 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base"}, "tree");
1225 if (defined $file_name) {
1226 print " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=history;h=$hash_base;f=$file_name"}, "history");
1228 print "<br/><br/>\n" .
1231 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML
($co{'title'})) . "\n" .
1234 print "<div class=\"page_nav\">\n" .
1235 "<br/><br/></div>\n" .
1236 "<div class=\"title\">$hash vs $hash_parent</div>\n";
1238 if (defined $file_name) {
1239 print "<div class=\"page_path\">\n" .
1243 print "<div class=\"page_body\">\n" .
1244 "<div class=\"diff_info\">blob:" .
1245 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$hash_parent;hb=$hash_base;f=$file_name"}, $hash_parent) .
1247 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name"}, $hash) .
1249 git_diff_html
($hash_parent, $file_name || $hash_parent, $hash, $file_name || $hash);
1254 sub git_commitdiff
{
1255 mkdir($gittmp, 0700);
1256 my %co = git_read_commit
($hash);
1258 die_error
(undef, "Unknown commit object.");
1260 open my $fd, "-|", "$gitbin/git-diff-tree -r $co{'parent'} $hash" || die_error
(undef, "Open failed.");
1261 my (@difftree) = map { chomp; $_ } <$fd>;
1262 close $fd || die_error
(undef, "Reading diff-tree failed.");
1265 print "<div class=\"page_nav\">\n" .
1266 $cgi->a({-href
=> "$my_uri?p=$project;a=log"}, "log") .
1267 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
1268 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") .
1269 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=" . $co{'tree'} . ";hb=$hash"}, "tree") .
1270 "<br/><br/></div>\n";
1272 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML
($co{'title'})) . "\n" .
1274 print "<div class=\"page_body\">\n";
1275 foreach my $line (@difftree) {
1276 # '*100644->100644 blob 8e5f9bbdf4de94a1bc4b4da8cb06677ce0a57716->8da3a306d0c0c070d87048d14a033df02f40a154 Makefile'
1277 $line =~ m/^(.)(.*)\t(.*)\t(.*)\t(.*)$/;
1283 if ($type eq "blob") {
1285 print "<div class=\"diff_info\">" . file_type
($mode) . ":" .
1286 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$id;hb=$hash;f=$file"}, $id) . "(new)" .
1288 git_diff_html
(undef, "/dev/null", $id, "b/$file");
1289 } elsif ($op eq "-") {
1290 print "<div class=\"diff_info\">" . file_type
($mode) . ":" .
1291 $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$id;hb=$hash;f=$file"}, $id) . "(deleted)" .
1293 git_diff_html
($id, "a/$file", undef, "/dev/null");
1294 } elsif ($op eq "*") {
1295 $id =~ m/([0-9a-fA-F]+)->([0-9a-fA-F]+)/;
1298 $mode =~ m/([0-7]+)->([0-7]+)/;
1301 if ($from_id ne $to_id) {
1302 print "<div class=\"diff_info\">" .
1303 file_type
($from_mode) . ":" . $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$from_id;hb=$hash;f=$file"}, $from_id) .
1305 file_type
($to_mode) . ":" . $cgi->a({-href
=> "$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$file"}, $to_id);
1307 git_diff_html
($from_id, "a/$file", $to_id, "b/$file");
1318 if (!defined $hash) {
1319 $hash = git_read_hash
("$project/HEAD");
1321 my %co = git_read_commit
($hash);
1323 die_error
(undef, "Unknown commit object.");
1326 print "<div class=\"page_nav\">\n" .
1327 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash"}, "commit") . " | " .
1328 $cgi->a({-href
=> "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") . " | " .
1329 $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") .
1333 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML
($co{'title'})) . "\n" .
1335 print "<div class=\"page_path\">\n" .
1336 "/$file_name<br/>\n";
1338 open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin $file_name";
1340 while (my $line = <$fd>) {
1341 if ($line =~ m/^([0-9a-fA-F]{40}) /){
1345 if ($line =~ m/^(.)(.*)\t(.*)\t(.*)\t(.*)$/ && (defined $commit)) {
1348 if ($file ne $file_name || $type ne "blob") {
1351 my %co = git_read_commit
($commit);
1355 print "<div class=\"list\">\n" .
1356 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$commit"},
1357 "<span class=\"age\">$co{'age_string'}</span>" . escapeHTML
($co{'title'})) . "\n" .
1359 print "<div class=\"list_link\">\n" .
1360 $cgi->a({-href
=> "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
1361 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=tree;h=" . $co{'tree'} . ";hb=$commit"}, "tree") .
1362 " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=blob;hb=$commit;f=$file"}, "blob");
1363 my $blob = git_get_hash_by_path
($hash, $file_name);
1364 my $blob_parent = git_get_hash_by_path
($commit, $file_name);
1365 if (defined $blob && defined $blob_parent && $blob ne $blob_parent) {
1366 print " | " . $cgi->a({-href
=> "$my_uri?p=$project;a=blobdiff;h=$blob;hp=$blob_parent;hb=$commit;f=$file"}, "diff");
This page took 1.565885 seconds and 3 git commands to generate.