{"thread":{"id":"43437","subject":"Re: [PATCH] gitweb: Check git base URLs before generating URL from it","startedAt":"2006-10-26T10:26:44Z","lastAt":"2006-10-26T17:39:12Z","messageCount":3,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"296665","messageId":"200610261226.44960.jnareb@gmail.com","threadId":"43437","inReplyTo":null,"subject":"[PATCH] gitweb: Check git base URLs before generating URL from it","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-26T10:26:44Z","receivedAt":"2006-10-26T10:26:44Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Check if each of git base URLs in @git_base_url_list is true before\nappending \"/$project\" to it to generate project URL.\n\nThis fixes the error that for default configuration for gitweb in\nMakefile, with GITWEB_BASE_URL empty (and \"++GITWEB_BASE_URL++\" being\n\"\" in gitweb.cgi), we had URL of \"/$project\" in the summary view.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nI don't think that anybody would want base URL of \"0\".\n\n gitweb/gitweb.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 35a9afb..0d2ea72 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2516,7 +2516,8 @@ sub git_summary {\n \t# or make project git URL from git base URL and project name\n \tmy $url_tag = \"URL\";\n \tmy @url_list = git_get_project_url_list($project);\n-\t@url_list = map { \"$_/$project\" } @git_base_url_list unless @url_list;\n+\t@url_list = map { $_ ? \"$_/$project\" : () }\n+\t\t@git_base_url_list unless @url_list;\n \tforeach my $git_url (@url_list) {\n \t\tnext unless $git_url;\n \t\tprint \"<tr><td>$url_tag</td><td>$git_url</td></tr>\\n\";\n-- \n1.4.3.3\n"},{"id":"295685","messageId":"7vr6wvkn66.fsf@assigned-by-dhcp.cox.net","threadId":"43437","inReplyTo":"200610261226.44960.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Check git base URLs before generating URL from it","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-26T17:21:53Z","receivedAt":"2006-10-26T17:21:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wouldn't this be simpler and more to the point, I wonder?\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 5a81b8f..aceaeb7 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -80,7 +80,7 @@ our $strict_export = \"++GITWEB_STRICT_EX\n \n # list of git base URLs used for URL to where fetch project from,\n # i.e. full URL is \"$git_base_url/$project\"\n-our @git_base_url_list = (\"++GITWEB_BASE_URL++\");\n+our @git_base_url_list = grep { $_ ne '' } (\"++GITWEB_BASE_URL++\");\n \n # default blob_plain mimetype and default charset for text/plain blob\n our $default_blob_plain_mimetype = 'text/plain';\n"},{"id":"294785","messageId":"ehqrqm$co1$1@sea.gmane.org","threadId":"43437","inReplyTo":"7vr6wvkn66.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: Check git base URLs before generating URL from it","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-26T17:39:12Z","receivedAt":"2006-10-26T17:39:12Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Wouldn't this be simpler and more to the point, I wonder?\n\n> -our @git_base_url_list = (\"++GITWEB_BASE_URL++\");\n> +our @git_base_url_list = grep { $_ ne '' } (\"++GITWEB_BASE_URL++\");\n\nYes, that would be cartainly better.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"}]}