Add git version to gitweb output
Add git-core binaries used version as the comment at the beginning of HTML output, just below the comment with version of git web interface version. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Jun 21, 2006 at 09:48 UTC
ae20de5386f74dbde991186694cfdac323b21e47
1 file changed
+11
-2
gitweb/gitweb.cgi
+11
-2
@@ -29,6 +29,14 @@ my $projectroot = "/home/kay/public_html/pub/scm";
29
# location of the git-core binaries
30
my $gitbin = "/usr/bin";
31
32
+# version of the git-core binaries
33
+my $git_version = qx($gitbin/git --version);
34
+if ($git_version =~ m/git version (.*)$/) {
35
+ $git_version = $1;
36
+} else {
37
+ $git_version = "unknown";
38
+}
39
+
40
# location for temporary files needed for diffs
41
my $git_temp = "/tmp/gitweb";
42
@@ -288,11 +296,12 @@ sub git_header_html {
296
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
297
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
298
<!-- git web interface v$version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
299
+<!-- git core binaries version $git_version -->
300
<head>
301
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
302
<meta name="robots" content="index, nofollow"/>
294
-<link rel="stylesheet" type="text/css" href="$stylesheet"/>
303
<title>$title</title>
304
+<link rel="stylesheet" type="text/css" href="$stylesheet"/>
305
$rss_link
306
</head>
307
<body>
@@ -816,7 +825,7 @@ sub git_get_project_config {
825
$key =~ s/^gitweb\.//;
826
return if ($key =~ m/\W/);
827
819
- my $val = qx(git-repo-config --get gitweb.$key);
828
+ my $val = qx($gitbin/git-repo-config --get gitweb.$key);
829
return ($val);
830
}
831