{"thread":{"id":"4601","subject":"[PATCH 3/3] Move $gitbin earlier in gitweb.cgi","startedAt":"2006-06-21T09:25:51Z","lastAt":"2006-06-21T09:25:54Z","messageCount":4,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"22186","messageId":"1150881954924-git-send-email-jnareb@gmail.com","threadId":"4601","inReplyTo":null,"subject":"[PATCH 0/3] Minor gitweb modifications and cleanups","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T09:25:51Z","receivedAt":"2006-06-21T09:25:51Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\nThis series of patches is based on git.git 'next' branch\n69d830d1a3a1236036bd0f84dd9794d7c8d34b3f\n\nMy future gitweb-related batches will be based on this series.\n\n---\n\n gitweb/gitweb.cgi |   53 +++++++++++++++++++++++++++++++----------------------\n gitweb/gitweb.css |    4 ++--\n 2 files changed, 33 insertions(+), 24 deletions(-)\n\n-- \nJakub Narebski \nShadeHawk on #git\n\n(git-send-email 1.4.0 with setlocale patch)\n"},{"id":"22185","messageId":"115088195576-git-send-email-jnareb@gmail.com","threadId":"4601","inReplyTo":"1150881954924-git-send-email-jnareb@gmail.com","subject":"[PATCH 1/3] gitweb: whitespace cleanup","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T09:25:52Z","receivedAt":"2006-06-21T09:25:52Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Do not use tabs to align variable initialization (actually use\ntabs only at the beginning of line, for code indent).  Remove trailing\nwhitespace.  Make whitespace usage more consistent.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n\n\n---\n\n gitweb/gitweb.cgi |   38 +++++++++++++++++++-------------------\n gitweb/gitweb.css |    4 ++--\n 2 files changed, 21 insertions(+), 21 deletions(-)\n\n691405ab79e0dacbe3b96a404740faf3f10bffd7\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 44896bb..89224e6 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -17,33 +17,33 @@ use Fcntl ':mode';\n binmode STDOUT, ':utf8';\n \n my $cgi = new CGI;\n-my $version =\t\t\"267\";\n-my $my_url =\t\t$cgi->url();\n-my $my_uri =\t\t$cgi->url(-absolute => 1);\n-my $rss_link =\t\t\"\";\n+my $version = \"267\";\n+my $my_url = $cgi->url();\n+my $my_uri = $cgi->url(-absolute => 1);\n+my $rss_link = \"\";\n \n # absolute fs-path which will be prepended to the project path\n-#my $projectroot =\t\"/pub/scm\";\n-my $projectroot =\t\"/home/kay/public_html/pub/scm\";\n+#my $projectroot = \"/pub/scm\";\n+my $projectroot = \"/home/kay/public_html/pub/scm\";\n \n # location of the git-core binaries\n-my $gitbin =\t\t\"/usr/bin\";\n+my $gitbin = \"/usr/bin\";\n \n # location for temporary files needed for diffs\n-my $git_temp =\t\t\"/tmp/gitweb\";\n+my $git_temp = \"/tmp/gitweb\";\n \n # target of the home link on top of all pages\n-my $home_link =\t\t$my_uri;\n+my $home_link = $my_uri;\n \n # html text to include at home page\n-my $home_text =\t\t\"indextext.html\";\n+my $home_text = \"indextext.html\";\n \n # URI of default stylesheet\n-my $stylesheet = \t\"gitweb.css\";\n+my $stylesheet = \"gitweb.css\";\n \n # source of projects list\n-#my $projects_list =\t$projectroot;\n-my $projects_list =\t\"index/index.aux\";\n+#my $projects_list = $projectroot;\n+my $projects_list = \"index/index.aux\";\n \n # default blob_plain mimetype and default charset for text/plain blob\n my $default_blob_plain_mimetype = 'text/plain';\n@@ -51,7 +51,7 @@ my $default_text_plain_charset  = undef;\n \n # file to use for guessing MIME types before trying /etc/mime.types\n # (relative to the current git repository)\n-my $mimetypes_file              = undef;\n+my $mimetypes_file = undef;\n \n \n # input validation and dispatch\n@@ -349,7 +349,7 @@ sub git_footer_html {\n \n sub die_error {\n \tmy $status = shift || \"403 Forbidden\";\n-\tmy $error = shift || \"Malformed query, file missing or permission denied\"; \n+\tmy $error = shift || \"Malformed query, file missing or permission denied\";\n \n \tgit_header_html($status);\n \tprint \"<div class=\\\"page_body\\\">\\n\" .\n@@ -1066,7 +1066,7 @@ sub git_summary {\n \t\t\t      \"<td>\";\n \t\t\tif (length($co{'title_short'}) < length($co{'title'})) {\n \t\t\t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$commit\"), -class => \"list\", -title => \"$co{'title'}\"},\n-\t\t\t              \"<b>\" . esc_html($co{'title_short'}) . \"$ref</b>\");\n+\t\t\t\t      \"<b>\" . esc_html($co{'title_short'}) . \"$ref</b>\");\n \t\t\t} else {\n \t\t\t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$commit\"), -class => \"list\"},\n \t\t\t\t      \"<b>\" . esc_html($co{'title'}) . \"$ref</b>\");\n@@ -1124,7 +1124,7 @@ sub git_summary {\n \t\t\t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=$tag{'reftype'};h=$tag{'refid'}\")}, $tag{'reftype'});\n \t\t\t\tif ($tag{'reftype'} eq \"commit\") {\n \t\t\t\t      print \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=shortlog;h=$tag{'name'}\")}, \"shortlog\") .\n-\t\t\t\t            \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=log;h=$tag{'refid'}\")}, \"log\");\n+\t\t\t\t\t    \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=log;h=$tag{'refid'}\")}, \"log\");\n \t\t\t\t}\n \t\t\t\tprint \"</td>\\n\" .\n \t\t\t\t      \"</tr>\";\n@@ -1362,7 +1362,7 @@ sub git_tags {\n \t\t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=$tag{'reftype'};h=$tag{'refid'}\")}, $tag{'reftype'});\n \t\t\tif ($tag{'reftype'} eq \"commit\") {\n \t\t\t      print \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=shortlog;h=$tag{'name'}\")}, \"shortlog\") .\n-\t\t\t            \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=log;h=$tag{'refid'}\")}, \"log\");\n+\t\t\t\t    \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=log;h=$tag{'refid'}\")}, \"log\");\n \t\t\t}\n \t\t\tprint \"</td>\\n\" .\n \t\t\t      \"</tr>\";\n@@ -1942,7 +1942,7 @@ sub git_commit {\n \t\t      \"</td>\" .\n \t\t      \"</tr>\\n\";\n \t}\n-\tprint \"</table>\". \n+\tprint \"</table>\".\n \t      \"</div>\\n\";\n \tprint \"<div class=\\\"page_body\\\">\\n\";\n \tmy $comment = $co{'comment'};\ndiff --git a/gitweb/gitweb.css b/gitweb/gitweb.css\nindex ac6a3c7..98410f5 100644\n--- a/gitweb/gitweb.css\n+++ b/gitweb/gitweb.css\n@@ -1,7 +1,7 @@\n body {\n \tfont-family: sans-serif;\n \tfont-size: 12px;\n-\tborder:solid #d9d8d1;\n+\tborder: solid #d9d8d1;\n \tborder-width: 1px;\n \tmargin: 10px;\n \tbackground-color: #ffffff;\n@@ -33,7 +33,7 @@ div.page_header a:hover {\n }\n \n div.page_nav {\n-\tpadding:8px;\n+\tpadding: 8px;\n }\n \n div.page_nav a:visited {\n-- \n1.3.0\n"},{"id":"22184","messageId":"1150881955505-git-send-email-jnareb@gmail.com","threadId":"4601","inReplyTo":"115088195576-git-send-email-jnareb@gmail.com","subject":"[PATCH 2/3] Add git version to gitweb output","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T09:25:53Z","receivedAt":"2006-06-21T09:25:53Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Add git-core binaries used version as the comment at the beginning of HTML\noutput, just below the comment with version of git web interface version.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n\n\n---\n\n gitweb/gitweb.cgi |   13 +++++++++++--\n 1 files changed, 11 insertions(+), 2 deletions(-)\n\n4434b02e9a56cf5d1939021b950bbe54240a413d\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"},{"id":"22183","messageId":"1150881955533-git-send-email-jnareb@gmail.com","threadId":"4601","inReplyTo":"1150881955505-git-send-email-jnareb@gmail.com","subject":"[PATCH 3/3] Move $gitbin earlier in gitweb.cgi","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-21T09:25:54Z","receivedAt":"2006-06-21T09:25:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"(cherry picked from 9dca843086356b964f27d8fabe1e3c48074a9f02 commit)\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n\n\n---\nCherry picked commit is from feature branch in my repository:\n  http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi?p=git.git;a=summary\n  http://front.fuw.edu.pl/jnareb/scm/git.git/\n\n gitweb/gitweb.cgi |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\nf8bd1032e0d6ec88f540a820b4f5b4789562ee05\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 87ec565..ef7fcbd 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -22,13 +22,13 @@ my $my_url = $cgi->url();\n my $my_uri = $cgi->url(-absolute => 1);\n my $rss_link = \"\";\n \n+# location of the git-core binaries\n+my $gitbin = \"/usr/bin\";\n+\n # absolute fs-path which will be prepended to the project path\n #my $projectroot = \"/pub/scm\";\n my $projectroot = \"/home/kay/public_html/pub/scm\";\n \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-- \n1.3.0\n"}]}