{"thread":{"id":"4590","subject":"[PATCH] Add git version to gitweb output","startedAt":"2006-06-20T15:59:59Z","lastAt":"2006-06-20T15:59:59Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22146","messageId":"11508191591838-git-send-email-jnareb@gmail.com","threadId":"4590","inReplyTo":null,"subject":"[PATCH] Add git version to gitweb output","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T15:59:59Z","receivedAt":"2006-06-20T15:59:59Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"---\n\n gitweb/gitweb.cgi |   13 +++++++++++--\n 1 files changed, 11 insertions(+), 2 deletions(-)\n\n09a68749cb29e1f0add3ac9859c11cd0924f70c7\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 89224e6..87ec565 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -29,6 +29,14 @@ my $projectroot = \"/home/kay/public_html\n # location of the git-core binaries\n my $gitbin = \"/usr/bin\";\n \n+# version of the git-core binaries\n+my $git_version = qx($gitbin/git --version);\n+if ($git_version =~ m/git version (.*)$/) {\n+\t$git_version = $1;\n+} else {\n+\t$git_version = \"unknown\";\n+}\n+\n # location for temporary files needed for diffs\n my $git_temp = \"/tmp/gitweb\";\n \n@@ -288,11 +296,12 @@ sub git_header_html {\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n <!-- git web interface v$version, (C) 2005-2006, Kay Sievers <kay.sievers\\@vrfy.org>, Christian Gierke -->\n+<!-- git core binaries version $git_version -->\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <meta name=\"robots\" content=\"index, nofollow\"/>\n-<link rel=\"stylesheet\" type=\"text/css\" href=\"$stylesheet\"/>\n <title>$title</title>\n+<link rel=\"stylesheet\" type=\"text/css\" href=\"$stylesheet\"/>\n $rss_link\n </head>\n <body>\n@@ -816,7 +825,7 @@ sub git_get_project_config {\n \t$key =~ s/^gitweb\\.//;\n \treturn if ($key =~ m/\\W/);\n \n-\tmy $val = qx(git-repo-config --get gitweb.$key);\n+\tmy $val = qx($gitbin/git-repo-config --get gitweb.$key);\n \treturn ($val);\n }\n \n-- \n1.3.0\n"}]}