Skip to content

Commit

Permalink
Add git version to gitweb output
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Jun 21, 2006
1 parent 7a9b4c5 commit ae20de5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gitweb/gitweb.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ my $projectroot = "/home/kay/public_html/pub/scm";
# location of the git-core binaries
my $gitbin = "/usr/bin";

# 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
my $git_temp = "/tmp/gitweb";

Expand Down Expand Up @@ -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">
<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 core binaries version $git_version -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="robots" content="index, nofollow"/>
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
<title>$title</title>
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
$rss_link
</head>
<body>
Expand Down Expand Up @@ -816,7 +825,7 @@ sub git_get_project_config {
$key =~ s/^gitweb\.//;
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);
}

Expand Down

0 comments on commit ae20de5

Please sign in to comment.