{"thread":{"id":"43746","subject":"[PATCH] gitweb: Add an option to href() to return full URL","startedAt":"2006-11-09T18:56:55Z","lastAt":"2006-11-09T18:56:55Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"297722","messageId":"200611091956.56069.jnareb@gmail.com","threadId":"43746","inReplyTo":null,"subject":"[PATCH] gitweb: Add an option to href() to return full URL","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-09T18:56:55Z","receivedAt":"2006-11-09T18:56:55Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"href() subroutine by default generates absolute URL (generated using\nCGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base;\nadd an option to generate full URL using $my_url as base.\n\nNew feature usage: href(..., -full=>1)\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis is in preparation for git_rss cleanup (to use href), and further\nper-branch (per-head) RSS feeds.\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 8313517..f3fe4bf 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -459,7 +459,8 @@ exit;\n \n sub href(%) {\n \tmy %params = @_;\n-\tmy $href = $my_uri;\n+\t# default is to use -absolute url() i.e. $my_uri\n+\tmy $href = $params{-full} ? $my_url : $my_uri;\n \n \t# XXX: Warning: If you touch this, check the search form for updating,\n \t# too.\n-- \n1.4.3.4\n"}]}