{"thread":{"id":"5278","subject":"[PATCH] gitweb: configurable home link string","startedAt":"2006-08-14T22:50:49Z","lastAt":"2006-08-15T22:11:48Z","messageCount":6,"participants":["Yasushi SHOJI","Jakub Narebski","Martin Waitz","Carl Worth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25319","messageId":"11555958491891-git-send-email-yashi@atmark-techno.com","threadId":"5278","inReplyTo":null,"subject":"[PATCH] gitweb: configurable home link string","fromName":"Yasushi SHOJI","fromEmail":"yashi@atmark-techno.com","sentAt":"2006-08-14T22:50:49Z","receivedAt":"2006-08-14T22:50:49Z","isPatch":true,"sender":{"key":"yashi@atmark-techno.com","avatar":"https://gravatar.com/avatar/4817e8703ac4379935834d87453faa9d0c94b9dc19d83fcc54c67875eb133e59?d=mp&s=160"},"body":"I've always found difficult to figure out git URL for clone from\ngitweb URL because git:// and http:// are different on many site\nincluding kernel.org.\n\nI've found this enhancement at http://dev.laptop.org/git when I was on\ngit channel, and thought that it'd be nice if all public gitweb site\nshow it's git URL on its page.\n\nThis patch allow us to change the home link string.  The current\ndefault is \"projects\" as we all see on gitweb now.\n\nie. kernel.org might set this variable to \"git://git.kernel.org/pub/scm/\"\n\nSigned-off-by: Yasushi SHOJI <yashi@atmark-techno.com>\n---\n Makefile           |    2 ++\n gitweb/gitweb.perl |    5 ++++-\n 2 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex a538710..b363f50 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -123,6 +123,7 @@ # DESTDIR=\n \n # default configuration for gitweb\n GITWEB_CONFIG = gitweb_config.perl\n+GITWEB_HOME_LINK_STR = projects\n GITWEB_SITENAME =\n GITWEB_PROJECTROOT = /pub/git\n GITWEB_LIST =\n@@ -617,6 +618,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n+\t    -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \\\n \t    -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \\\n \t    -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \\\n \t    -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \\\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 626fcc9..76e8376 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -36,6 +36,9 @@ our $git_temp = \"/tmp/gitweb\";\n # target of the home link on top of all pages\n our $home_link = $my_uri;\n \n+# string of the home link on top of all pages\n+our $home_link_str = \"++GITWEB_HOME_LINK_STR++\";\n+\n # name of your site or organization to appear in page titles\n # replace this with something more descriptive for clearer bookmarks\n our $site_name = \"++GITWEB_SITENAME++\" || $ENV{'SERVER_NAME'} || \"Untitled\";\n@@ -890,7 +893,7 @@ EOF\n \t      \"<a href=\\\"http://www.kernel.org/pub/software/scm/git/docs/\\\" title=\\\"git documentation\\\">\" .\n \t      \"<img src=\\\"$logo\\\" width=\\\"72\\\" height=\\\"27\\\" alt=\\\"git\\\" style=\\\"float:right; border-width:0px;\\\"/>\" .\n \t      \"</a>\\n\";\n-\tprint $cgi->a({-href => esc_param($home_link)}, \"projects\") . \" / \";\n+\tprint $cgi->a({-href => esc_param($home_link)}, $home_link_str) . \" / \";\n \tif (defined $project) {\n \t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=summary\")}, esc_html($project));\n \t\tif (defined $action) {\n-- \n1.4.2.g182a\n"},{"id":"25360","messageId":"ebsrsn$tgq$1@sea.gmane.org","threadId":"5278","inReplyTo":"11555958491891-git-send-email-yashi@atmark-techno.com","subject":"Re: [PATCH] gitweb: configurable home link string","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-15T16:15:05Z","receivedAt":"2006-08-15T16:15:05Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Yasushi SHOJI wrote:\n\n> I've always found difficult to figure out git URL for clone from\n> gitweb URL because git:// and http:// are different on many site\n> including kernel.org.\n> \n> I've found this enhancement at http://dev.laptop.org/git when I was on\n> git channel, and thought that it'd be nice if all public gitweb site\n> show it's git URL on its page.\n> \n> This patch allow us to change the home link string.  The current\n> default is \"projects\" as we all see on gitweb now.\n> \n> ie. kernel.org might set this variable to \"git://git.kernel.org/pub/scm/\"\n> \n> Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>\n\nThere is similar improvement in gitweb-xmms2, where the git clone/fetch\nURL for an individual project is visible in the \"summary\" page for project,\nsee e.g.\n  http://git.xmms.se/?p=gitweb-xmms2.git;a=summary\n\nI plan on implementing such a feature, with an improvement that URL is not\ndisplayed if $git_base_url (your $home_link_str) is not defined (e.g.\nrepository is not published)... or you can reimplement this feature.\n \nhttp://git.xmms.se/?p=gitweb-xmms2.git;a=commit;h=8e327dfbdebedd0c5fc02fe606fd4675b43237d7\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"25374","messageId":"20060815192737.GA14459@admingilde.org","threadId":"5278","inReplyTo":"ebsrsn$tgq$1@sea.gmane.org","subject":"Re: [PATCH] gitweb: configurable home link string","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-08-15T19:27:37Z","receivedAt":"2006-08-15T19:27:37Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Tue, Aug 15, 2006 at 06:15:05PM +0200, Jakub Narebski wrote:\n> There is similar improvement in gitweb-xmms2, where the git clone/fetch\n> URL for an individual project is visible in the \"summary\" page for project,\n\ndoesn't it make more sense to make it more easy to use the same URL for\ngit:, http: and gitweb?\n\n-- \nMartin Waitz\n"},{"id":"25376","messageId":"8fe92b430608151236l35ff169cjea6580250182b5ef@mail.gmail.com","threadId":"5278","inReplyTo":"20060815192737.GA14459@admingilde.org","subject":"Re: [PATCH] gitweb: configurable home link string","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-15T19:36:43Z","receivedAt":"2006-08-15T19:36:43Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On 8/15/06, Martin Waitz <tali@admingilde.org> wrote:\n> On Tue, Aug 15, 2006 at 06:15:05PM +0200, Jakub Narebski wrote:\n>> There is similar improvement in gitweb-xmms2, where the git clone/fetch\n>> URL for an individual project is visible in the \"summary\" page for project,\n>\n> doesn't it make more sense to make it more easy to use the same URL for\n> git:, http: and gitweb?\n\nIt is not always possible to use the same URL for gitweb and http://\naccess, for example gitweb might require /cgi-bin/ in path. git:// and\ngit+ssh:// access migh need different path than http:// access.\n\nWith PATH_INFO for 'project' parameter actually used gitweb link would\nbe the same as http:// access link; the problem would be to\ndifferentiate which handle using gitweb.cgi, and which handle\ndirectly.\n-- \nJakub Narebski\n"},{"id":"25379","messageId":"87mza5ycfr.wl%cworth@cworth.org","threadId":"5278","inReplyTo":"8fe92b430608151236l35ff169cjea6580250182b5ef@mail.gmail.com","subject":"Re: [PATCH] gitweb: configurable home link string","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2006-08-15T20:24:40Z","receivedAt":"2006-08-15T20:24:40Z","isPatch":true,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"On Tue, 15 Aug 2006 21:36:43 +0200, \"Jakub Narebski\" wrote:\n> On 8/15/06, Martin Waitz <tali@admingilde.org> wrote:\n> >\n> > doesn't it make more sense to make it more easy to use the same URL for\n> > git:, http: and gitweb?\n>\n> It is not always possible to use the same URL for gitweb and http://\n> access, for example gitweb might require /cgi-bin/ in path. git:// and\n> git+ssh:// access migh need different path than http:// access.\n>\n> With PATH_INFO for 'project' parameter actually used gitweb link would\n> be the same as http:// access link;\n\nAnd for someone who has enough control to make consistent URLs happen,\ncould anyone provide guidance on how to make this work? Specifically,\nI'm interested in getting at the PATH_INFO for project functionality.\n\nCurrently I've got gitweb running at the root URL on its own domain\nwith the following apache configuration:\n\n\tScriptAlias / /usr/lib/cgi-bin/gitweb\n\nSo I can currently browse a project with something like:\n\n\thttp://gitweb.freedesktop.org/?p=cairo.git\n\nBut if I try to put the project name as part of the path:\n\n\thttp://gitweb.freedesktop.org/cairo.git\n\nThen I just get a 404. So what do I need to configure to get the\nPATH_INFO stuff to work?\n\nAlso, is there support in gitweb for not requiring the \".git\" suffix\neven though that exists in the directory on the filesystem? The URL I\nreally want to use is:\n\n\thttp://gitweb.freedesktop.org/cairo\n\nFinally, once I get that working, I would like gitweb to generate URLs\nof this form in the link it generates. Does it have that capability\nyet? (It would also be nice if it didn't append options that are the\ndefault anyway, such as \";a=summary\").\n\nThanks in advance,\n\n-Carl\n\nPS. Oh, and then the final thing I'd want is to allow someone to cut\nand paste a gitweb URL such as the above to \"git clone\" and then some\nmagic would forward things such that the git daemon would serve the\ndata. Has anyone got that working? And for bonus points, it would also\nfail over to http:// cloning if git:// cloning weren't possible for\nsome reason.\n"},{"id":"25387","messageId":"20060815221147.GB14459@admingilde.org","threadId":"5278","inReplyTo":"87mza5ycfr.wl%cworth@cworth.org","subject":"Re: [PATCH] gitweb: configurable home link string","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-08-15T22:11:48Z","receivedAt":"2006-08-15T22:11:48Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Tue, Aug 15, 2006 at 01:24:40PM -0700, Carl Worth wrote:\n> Currently I've got gitweb running at the root URL on its own domain\n> with the following apache configuration:\n> \n> \tScriptAlias / /usr/lib/cgi-bin/gitweb\n\nI use the following configuration:\n\n    DocumentRoot /pub/git\n    RewriteEngine on\n    RewriteRule ^/(.*\\.git/(.*\\.html)?)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]\n\nthis has the advantage that normal http: repository accesses go to the\nnormal web server and only gitweb accesses go to the CGI.\n\n> Finally, once I get that working, I would like gitweb to generate URLs\n> of this form in the link it generates. Does it have that capability\n> yet? (It would also be nice if it didn't append options that are the\n> default anyway, such as \";a=summary\").\n\nI had this for an very old gitweb version and am currently\nreimplementing it for current gitweb versions.\n\n-- \nMartin Waitz\n"}]}