summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 927dcec)
raw | patch | inline | side by side (parent: 927dcec)
author | Kay Sievers <kay.sievers@suse.de> | |
Sun, 7 Aug 2005 18:19:45 +0000 (20:19 +0200) | ||
committer | Kay Sievers <kay.sievers@suse.de> | |
Sun, 7 Aug 2005 18:19:45 +0000 (20:19 +0200) |
gitweb.cgi | patch | blob | history |
diff --git a/gitweb.cgi b/gitweb.cgi
index fa2ba70aadc9d3dd30f1d80452fb8b04cb072338..15bb123b21f3a474249c3770bbde5c224d452c94 100755 (executable)
--- a/gitweb.cgi
+++ b/gitweb.cgi
my $cgi = new CGI;
-my $version = "080";
+my $version = "082";
my $projectroot = "/pub/scm";
my $home_link = "/git";
my $gitbin = "/usr/bin";
my $my_url = $cgi->url();
my $my_uri = $cgi->url(-absolute => 1);
-# remove #
-my $projectroot = "/home/kay/public_html/pub/scm";
-my $home_link = "/~kay/git";
-my $logo_link = "/~kay/pub/software/scm/cogito";
-# remove #
-
mkdir($gittmp, 0700);
my $project = $cgi->param('p');
my $action = $cgi->param('a');
my %co;
my @parents;
- open my $fd, "-|", "$gitbin/git-cat-file commit $commit";
+ open my $fd, "-|", "$gitbin/cat-file commit $commit";
while (my $line = <$fd>) {
chomp($line);
last if $line eq "";
if ($from ne "") {
$from_tmp = "$gittmp/gitweb_" . $$ . "_from";
open(my $fd2, "> $from_tmp");
- open my $fd, "-|", "$gitbin/git-cat-file blob $from";
+ open my $fd, "-|", "$gitbin/cat-file blob $from";
my @file = <$fd>;
print $fd2 @file;
close $fd2;
if ($to ne "") {
$to_tmp = "$gittmp/gitweb_" . $$ . "_to";
open my $fd2, "> $to_tmp";
- open my $fd, "-|", "$gitbin/git-cat-file blob $to";
+ open my $fd, "-|", "$gitbin/cat-file blob $to";
my @file = <$fd>;
print $fd2 @file;
close $fd2;
print "<br/><br/></div>\n";
print "<div class=\"title\">$hash</div>\n";
print "<div class=\"page_body\"><pre>\n";
- open(my $fd, "-|", "$gitbin/git-cat-file blob $hash");
+ open(my $fd, "-|", "$gitbin/cat-file blob $hash");
my $nr;
while (my $line = <$fd>) {
$nr++;
if ($hash eq "") {
$hash = git_head($project);
}
- open my $fd, "-|", "$gitbin/git-ls-tree $hash";
+ open my $fd, "-|", "$gitbin/ls-tree $hash";
my (@entries) = map { chomp; $_ } <$fd>;
close $fd;
print "<br/></div>";
git_footer_html();
} elsif ($action eq "log" || $action eq "rss") {
- open my $fd, "-|", "$gitbin/git-rev-list " . git_head($project);
+ open my $fd, "-|", "$gitbin/rev-list " . git_head($project);
my (@revlist) = map { chomp; $_ } <$fd>;
close $fd;
}
my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});
my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});
- open my $fd, "-|", "$gitbin/git-diff-tree -r " . $co{'parent'} . " $hash";
+ open my $fd, "-|", "$gitbin/diff-tree -r " . $co{'parent'} . " $hash";
my (@difftree) = map { chomp; $_ } <$fd>;
close $fd;
if ($from_mode != $to_mode) {
$mode_chnge = " <span style=\"color: #888888;\"> [chmod $mode]</span>\n";
}
- print "<div class=\"list\">\n" .
- $cgi->a({-href => "$my_uri?p=$project;a=blobdiff;h=$to_id"},
- escapeHTML($file) . $mode_chnge) . "\n" .
- "</div>\n";
+ print "<div class=\"list\">\n";
+ if ($to_id ne $from_id) {
+ print $cgi->a({-href => "$my_uri?p=$project;a=blobdiff;h=$to_id;hp=$from_id"},
+ escapeHTML($file) . $mode_chnge) . "\n" .
+ "</div>\n";
+ } else {
+ print $cgi->a({-href => "$my_uri?p=$project;a=blob;h=$to_id"},
+ escapeHTML($file) . $mode_chnge) . "\n" .
+ "</div>\n";
+ }
print "<div class=\"link\">\n" .
"view ";
if ($to_id ne $from_id) {
if (!defined(%co)) {
die_error("", "Unknown commit object.");
}
- open my $fd, "-|", "$gitbin/git-diff-tree -r " . $co{'parent'} . " $hash";
+ open my $fd, "-|", "$gitbin/diff-tree -r " . $co{'parent'} . " $hash";
my (@difftree) = map { chomp; $_ } <$fd>;
close $fd;
if (!(defined($hash))) {
$hash = git_head($project);
}
- open my $fd, "-|", "$gitbin/git-rev-list $hash";
+ open my $fd, "-|", "$gitbin/rev-list $hash";
my (@revlist) = map { chomp; $_ } <$fd>;
close $fd;
my $parents = $co{'parents'};
my $found = 0;
foreach my $parent (@$parents) {
- open $fd, "-|", "$gitbin/git-diff-tree -r $parent $rev $file_name";
+ open $fd, "-|", "$gitbin/diff-tree -r $parent $rev $file_name";
my (@difftree) = map { chomp; $_ } <$fd>;
close $fd;
}
git_footer_html();
} else {
- die_error("", "unknown action");
+ die_error("", "Unknown action.");
}