gitweb: whitespace cleanup
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Jul 29, 2006 at 22:43 UTC
5be01bc8d5cf9c63827311ad76dd8b66353253e1
1 file changed
+30
-28
gitweb/gitweb.cgi
+30
-28
@@ -36,7 +36,7 @@ our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
36
# location for temporary files needed for diffs
37
our $git_temp = "/tmp/gitweb";
38
if (! -d $git_temp) {
39
- mkdir($git_temp, 0700) || die_error("Couldn't mkdir $git_temp");
39
+ mkdir($git_temp, 0700) || die_error("Couldn't mkdir $git_temp");
40
}
41
42
# target of the home link on top of all pages
@@ -104,7 +104,7 @@ if (defined $project) {
104
die_error(undef, "No such project.");
105
}
106
$rss_link = "<link rel=\"alternate\" title=\"" . esc_param($project) . " log\" href=\"" .
107
- "$my_uri?" . esc_param("p=$project;a=rss") . "\" type=\"application/rss+xml\"/>";
107
+ "$my_uri?" . esc_param("p=$project;a=rss") . "\" type=\"application/rss+xml\"/>";
108
$ENV{'GIT_DIR'} = "$projectroot/$project";
109
} else {
110
git_project_list();
@@ -303,7 +303,7 @@ sub git_header_html {
303
} else {
304
$content_type = 'text/html';
305
}
306
- print $cgi->header(-type=>$content_type, -charset => 'utf-8', -status=> $status, -expires => $expires);
306
+ print $cgi->header(-type=>$content_type, -charset => 'utf-8', -status=> $status, -expires => $expires);
307
print <<EOF;
308
<?xml version="1.0" encoding="utf-8"?>
309
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -1138,17 +1138,17 @@ sub git_summary {
1138
"</td>\n" .
1139
"<td>";
1140
if (defined($comment)) {
1141
- print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, esc_html($comment));
1141
+ print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, esc_html($comment));
1142
}
1143
print "</td>\n" .
1144
"<td class=\"link\">";
1145
if ($tag{'type'} eq "tag") {
1146
- print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, "tag") . " | ";
1146
+ print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, "tag") . " | ";
1147
}
1148
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'});
1149
if ($tag{'reftype'} eq "commit") {
1150
- print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
1151
- " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
1150
+ print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
1151
+ " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
1152
}
1153
print "</td>\n" .
1154
"</tr>";
@@ -1457,17 +1457,17 @@ sub git_tags {
1457
"</td>\n" .
1458
"<td>";
1459
if (defined($comment)) {
1460
- print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, $comment);
1460
+ print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, $comment);
1461
}
1462
print "</td>\n" .
1463
"<td class=\"link\">";
1464
if ($tag{'type'} eq "tag") {
1465
- print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, "tag") . " | ";
1465
+ print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, "tag") . " | ";
1466
}
1467
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'});
1468
if ($tag{'reftype'} eq "commit") {
1469
- print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
1470
- " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
1469
+ print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
1470
+ " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
1471
}
1472
print "</td>\n" .
1473
"</tr>";
@@ -1613,13 +1613,14 @@ sub git_blob_plain_mimetype {
1613
1614
sub git_blob_plain {
1615
if (!defined $hash) {
1616
- if (defined $file_name) {
1617
- my $base = $hash_base || git_read_head($project);
1618
- $hash = git_get_hash_by_path($base, $file_name, "blob") || die_error(undef, "Error lookup file.");
1619
- } else {
1620
- die_error(undef, "No file name defined.");
1621
- }
1622
- }
1616
+ if (defined $file_name) {
1617
+ my $base = $hash_base || git_read_head($project);
1618
+ $hash = git_get_hash_by_path($base, $file_name, "blob")
1619
+ or die_error(undef, "Error lookup file.");
1620
+ } else {
1621
+ die_error(undef, "No file name defined.");
1622
+ }
1623
+ }
1624
my $type = shift;
1625
open my $fd, "-|", "$GIT cat-file blob $hash" or die_error("Couldn't cat $file_name, $hash");
1626
@@ -1644,13 +1645,14 @@ sub git_blob_plain {
1645
1646
sub git_blob {
1647
if (!defined $hash) {
1647
- if (defined $file_name) {
1648
- my $base = $hash_base || git_read_head($project);
1649
- $hash = git_get_hash_by_path($base, $file_name, "blob") || die_error(undef, "Error lookup file.");
1650
- } else {
1651
- die_error(undef, "No file name defined.");
1652
- }
1653
- }
1648
+ if (defined $file_name) {
1649
+ my $base = $hash_base || git_read_head($project);
1650
+ $hash = git_get_hash_by_path($base, $file_name, "blob")
1651
+ or die_error(undef, "Error lookup file.");
1652
+ } else {
1653
+ die_error(undef, "No file name defined.");
1654
+ }
1655
+ }
1656
my $have_blame = git_get_project_config_bool ('blame');
1657
open my $fd, "-|", "$GIT cat-file blob $hash" or die_error(undef, "Open failed.");
1658
my $mimetype = git_blob_plain_mimetype($fd, $file_name);
@@ -1677,7 +1679,7 @@ sub git_blob {
1679
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$hash")}, "plain") . "<br/>\n";
1680
}
1681
print "</div>\n".
1680
- "<div>" .
1682
+ "<div>" .
1683
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) .
1684
"</div>\n";
1685
} else {
@@ -2305,7 +2307,7 @@ sub git_commitdiff {
2307
my $status = $5;
2308
my $file = validate_input(unquote($6));
2309
if ($status eq "A") {
2308
- print "<div class=\"diff_info\">" . file_type($to_mode) . ":" .
2310
+ print "<div class=\"diff_info\">" . file_type($to_mode) . ":" .
2311
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, $to_id) . "(new)" .
2312
"</div>\n";
2313
git_diff_print(undef, "/dev/null", $to_id, "b/$file");
@@ -2359,7 +2361,7 @@ sub git_commitdiff_plain {
2361
"Date: $ad{'rfc2822'} ($ad{'tz_local'})\n".
2362
"Subject: $co{'title'}\n";
2363
if (defined $tagname) {
2362
- print "X-Git-Tag: $tagname\n";
2364
+ print "X-Git-Tag: $tagname\n";
2365
}
2366
print "X-Git-Url: $my_url?p=$project;a=commitdiff;h=$hash\n" .
2367
"\n";