{"thread":{"id":"3814","subject":"gitweb: A git:// link for the project?","startedAt":"2006-04-06T19:14:34Z","lastAt":"2006-04-06T19:14:34Z","messageCount":1,"participants":["Jan-Benedict Glaw"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18429","messageId":"20060406191434.GX13324@lug-owl.de","threadId":"3814","inReplyTo":null,"subject":"gitweb: A git:// link for the project?","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2006-04-06T19:14:34Z","receivedAt":"2006-04-06T19:14:34Z","isPatch":false,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"Hi Kay!\n\nI've got another small idea for gitweb, probably only a line or two,\nbut Perl isn't exactly my preferred language :)\n\nThe idea is to have a 'Copy Link-Lokation'able link presented by\ngitweb, maybe placed right to summary, shortlog and log.\n\nThat should just link to a URL prefix\n(git://git.yourbox.tld/some/path) plus the project path. I guess it's\nsomething like this, but I haven't tested it. Should be good enough to\nget an idea of what I ment:\n\nSigned-off-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>\n\ndiff --git a/gitweb.cgi b/gitweb.cgi\nindex c1bb624..b2942fd 100755\n--- a/gitweb.cgi\n+++ b/gitweb.cgi\n@@ -26,6 +26,9 @@ my $rss_link =\t\t\"\";\n #my $projectroot =\t\"/pub/scm\";\n my $projectroot =\t\"/home/kay/public_html/pub/scm\";\n \n+# URL prefix for the git:// link\n+my $urlprefix =\t\t\"git://git.kernel.org/pub/scm\";\n+\n # location of the git-core binaries\n my $gitbin =\t\t\"/usr/bin\";\n \n@@ -920,6 +923,7 @@ sub git_project_list {\n \t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$pr->{'path'};a=summary\")}, \"summary\") .\n \t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$pr->{'path'};a=shortlog\")}, \"shortlog\") .\n \t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$pr->{'path'};a=log\")}, \"log\") .\n+\t\t      \" | \" . $cgi->a({-href => \"$urlprefix\" . esc_param(\"/$pr->{'path'}\")}, \"GIT\") .\n \t\t      \"</td>\\n\" .\n \t\t      \"</tr>\\n\";\n \t}\n\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n für einen Freien Staat voll Freier Bürger\"  | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"}]}