Merge branch 'jn/web' into next
* jn/web: Move $gitbin earlier in gitweb.cgi Add git version to gitweb output gitweb: whitespace cleanup
This commit is contained in:
commit
48401221b3
@ -17,33 +17,41 @@ use Fcntl ':mode';
|
|||||||
binmode STDOUT, ':utf8';
|
binmode STDOUT, ':utf8';
|
||||||
|
|
||||||
my $cgi = new CGI;
|
my $cgi = new CGI;
|
||||||
my $version = "267";
|
my $version = "267";
|
||||||
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 = "";
|
||||||
|
|
||||||
# absolute fs-path which will be prepended to the project path
|
|
||||||
#my $projectroot = "/pub/scm";
|
|
||||||
my $projectroot = "/home/kay/public_html/pub/scm";
|
|
||||||
|
|
||||||
# location of the git-core binaries
|
# location of the git-core binaries
|
||||||
my $gitbin = "/usr/bin";
|
my $gitbin = "/usr/bin";
|
||||||
|
|
||||||
|
# absolute fs-path which will be prepended to the project path
|
||||||
|
#my $projectroot = "/pub/scm";
|
||||||
|
my $projectroot = "/home/kay/public_html/pub/scm";
|
||||||
|
|
||||||
|
# version of the git-core binaries
|
||||||
|
my $git_version = qx($gitbin/git --version);
|
||||||
|
if ($git_version =~ m/git version (.*)$/) {
|
||||||
|
$git_version = $1;
|
||||||
|
} else {
|
||||||
|
$git_version = "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
# location for temporary files needed for diffs
|
# location for temporary files needed for diffs
|
||||||
my $git_temp = "/tmp/gitweb";
|
my $git_temp = "/tmp/gitweb";
|
||||||
|
|
||||||
# target of the home link on top of all pages
|
# target of the home link on top of all pages
|
||||||
my $home_link = $my_uri;
|
my $home_link = $my_uri;
|
||||||
|
|
||||||
# html text to include at home page
|
# html text to include at home page
|
||||||
my $home_text = "indextext.html";
|
my $home_text = "indextext.html";
|
||||||
|
|
||||||
# URI of default stylesheet
|
# URI of default stylesheet
|
||||||
my $stylesheet = "gitweb.css";
|
my $stylesheet = "gitweb.css";
|
||||||
|
|
||||||
# source of projects list
|
# source of projects list
|
||||||
#my $projects_list = $projectroot;
|
#my $projects_list = $projectroot;
|
||||||
my $projects_list = "index/index.aux";
|
my $projects_list = "index/index.aux";
|
||||||
|
|
||||||
# default blob_plain mimetype and default charset for text/plain blob
|
# default blob_plain mimetype and default charset for text/plain blob
|
||||||
my $default_blob_plain_mimetype = 'text/plain';
|
my $default_blob_plain_mimetype = 'text/plain';
|
||||||
@ -51,7 +59,7 @@ my $default_text_plain_charset = undef;
|
|||||||
|
|
||||||
# file to use for guessing MIME types before trying /etc/mime.types
|
# file to use for guessing MIME types before trying /etc/mime.types
|
||||||
# (relative to the current git repository)
|
# (relative to the current git repository)
|
||||||
my $mimetypes_file = undef;
|
my $mimetypes_file = undef;
|
||||||
|
|
||||||
|
|
||||||
# input validation and dispatch
|
# input validation and dispatch
|
||||||
@ -288,11 +296,12 @@ sub git_header_html {
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
|
||||||
<!-- git web interface v$version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
|
<!-- git web interface v$version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
|
||||||
|
<!-- git core binaries version $git_version -->
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||||
<meta name="robots" content="index, nofollow"/>
|
<meta name="robots" content="index, nofollow"/>
|
||||||
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
|
|
||||||
<title>$title</title>
|
<title>$title</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
|
||||||
$rss_link
|
$rss_link
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -349,7 +358,7 @@ sub git_footer_html {
|
|||||||
|
|
||||||
sub die_error {
|
sub die_error {
|
||||||
my $status = shift || "403 Forbidden";
|
my $status = shift || "403 Forbidden";
|
||||||
my $error = shift || "Malformed query, file missing or permission denied";
|
my $error = shift || "Malformed query, file missing or permission denied";
|
||||||
|
|
||||||
git_header_html($status);
|
git_header_html($status);
|
||||||
print "<div class=\"page_body\">\n" .
|
print "<div class=\"page_body\">\n" .
|
||||||
@ -816,7 +825,7 @@ sub git_get_project_config {
|
|||||||
$key =~ s/^gitweb\.//;
|
$key =~ s/^gitweb\.//;
|
||||||
return if ($key =~ m/\W/);
|
return if ($key =~ m/\W/);
|
||||||
|
|
||||||
my $val = qx(git-repo-config --get gitweb.$key);
|
my $val = qx($gitbin/git-repo-config --get gitweb.$key);
|
||||||
return ($val);
|
return ($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1066,7 +1075,7 @@ sub git_summary {
|
|||||||
"<td>";
|
"<td>";
|
||||||
if (length($co{'title_short'}) < length($co{'title'})) {
|
if (length($co{'title_short'}) < length($co{'title'})) {
|
||||||
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
|
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
|
||||||
"<b>" . esc_html($co{'title_short'}) . "$ref</b>");
|
"<b>" . esc_html($co{'title_short'}) . "$ref</b>");
|
||||||
} else {
|
} else {
|
||||||
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"},
|
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"},
|
||||||
"<b>" . esc_html($co{'title'}) . "$ref</b>");
|
"<b>" . esc_html($co{'title'}) . "$ref</b>");
|
||||||
@ -1124,7 +1133,7 @@ sub git_summary {
|
|||||||
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'});
|
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'});
|
||||||
if ($tag{'reftype'} eq "commit") {
|
if ($tag{'reftype'} eq "commit") {
|
||||||
print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
|
print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
|
||||||
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
|
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
|
||||||
}
|
}
|
||||||
print "</td>\n" .
|
print "</td>\n" .
|
||||||
"</tr>";
|
"</tr>";
|
||||||
@ -1362,7 +1371,7 @@ sub git_tags {
|
|||||||
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'});
|
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'});
|
||||||
if ($tag{'reftype'} eq "commit") {
|
if ($tag{'reftype'} eq "commit") {
|
||||||
print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
|
print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") .
|
||||||
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
|
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log");
|
||||||
}
|
}
|
||||||
print "</td>\n" .
|
print "</td>\n" .
|
||||||
"</tr>";
|
"</tr>";
|
||||||
@ -1942,7 +1951,7 @@ sub git_commit {
|
|||||||
"</td>" .
|
"</td>" .
|
||||||
"</tr>\n";
|
"</tr>\n";
|
||||||
}
|
}
|
||||||
print "</table>".
|
print "</table>".
|
||||||
"</div>\n";
|
"</div>\n";
|
||||||
print "<div class=\"page_body\">\n";
|
print "<div class=\"page_body\">\n";
|
||||||
my $comment = $co{'comment'};
|
my $comment = $co{'comment'};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
body {
|
body {
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
border:solid #d9d8d1;
|
border: solid #d9d8d1;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
@ -33,7 +33,7 @@ div.page_header a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.page_nav {
|
div.page_nav {
|
||||||
padding:8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.page_nav a:visited {
|
div.page_nav a:visited {
|
||||||
|
Loading…
Reference in New Issue
Block a user