{"thread":{"id":"25376","subject":"Gitweb: Show git clone url on projects list","startedAt":"2010-10-07T08:47:03Z","lastAt":"2010-10-11T23:11:08Z","messageCount":4,"participants":["Manuel Doninger","Jakub Narebski","J.H."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"152861","messageId":"AANLkTimGhR_64CDKuN0x4Lk6Ve8rr7BAOCL1uGUkQv6v@mail.gmail.com","threadId":"25376","inReplyTo":"AANLkTi=5P1OiKprOifyu2xuFjVToL5kE9dXrEr3gSr+_@mail.gmail.com","subject":"Gitweb: Show git clone url on projects list","fromName":"Manuel Doninger","fromEmail":"manuel@doninger.net","sentAt":"2010-10-07T08:47:03Z","receivedAt":"2010-10-07T08:47:03Z","isPatch":false,"sender":{"key":"manuel@doninger.net","avatar":null},"body":"Hi,\ni installed gitweb on my server, and it works great.\nIn gitweb.conf i defined @git_base_url_list, an on every projects\nstatus page the clone url is shown.\nBut i want also the clone url shown on the projects list, like on\nhttp://git.kernel.org/ (the \"git\" link on the right border of every\nline).\nHow can i do this (i use git 1.7.3)?\n\nRegards,\nManuel Doninger\n"},{"id":"152864","messageId":"m3iq1efhlp.fsf@localhost.localdomain","threadId":"25376","inReplyTo":"AANLkTimGhR_64CDKuN0x4Lk6Ve8rr7BAOCL1uGUkQv6v@mail.gmail.com","subject":"Re: Gitweb: Show git clone url on projects list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-07T10:00:56Z","receivedAt":"2010-10-07T10:00:56Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Manuel Doninger <manuel@doninger.net> writes:\n\n> I installed gitweb on my server, and it works great.\n> In gitweb.conf I defined @git_base_url_list, an on every projects\n> status page the clone url is shown.\n> But I want also the clone url shown on the projects list, like on\n> http://git.kernel.org/ (the \"git\" link on the right border of every\n> line).\n> How can I do this (i use git 1.7.3)?\n\nThe http://git.kernel.org site uses *modified* gitweb, which among\nothers include support for _git_ link on projects_list page.  You can\nget it from\n  http://git.kernel.org/?p=git/warthog9/gitweb.git      (gitweb)\n  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git  (clone url)\nYou would need only `--depth=1` shallow clone.\n\nThere were multiple attempts to add such link to core gitweb (i.e. the\none present in git 1.7.3), but were not merged in due to runing\naground the following problems:\n\n1. There might be more than one link for one git repository.  One can\n   provide git://, http:// and ssh:// URLs.  Which one to chose?\n\n   This issue might be solved by either using first one on the list,\n   or filtering and showing link(s) to anonymous unauthenticated ones,\n   i.e. _git_ link (if git:// URL exists) and perhaps _http_ link (if\n   http:// URL exists).\n\n2. More important issue is that besides @git_base_url_list the URL or\n   URLs for a repository can come from various other places: from\n   'cloneurl' text file and from `gitweb.url' configuration variable.\n   It it was taken into account (even to check that such configuration\n   does not exist) it would badly affect performance of generating\n   projects list page.\n\n   The git.kernel.org gitweb doesn't have this problem because it uses\n   @git_base_url_list (I think unconditionally); also it supports\n   output caching, so eventual performance hit is migitated.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"153260","messageId":"4CB3812B.8060209@eaglescrag.net","threadId":"25376","inReplyTo":"m3iq1efhlp.fsf@localhost.localdomain","subject":"Re: Gitweb: Show git clone url on projects list","fromName":"J.H.","fromEmail":"warthog19@eaglescrag.net","sentAt":"2010-10-11T21:27:07Z","receivedAt":"2010-10-11T21:27:07Z","isPatch":false,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"Sorry for the late response, was traveling on the 7th.  Comments inline.\n\n> There were multiple attempts to add such link to core gitweb (i.e. the\n> one present in git 1.7.3), but were not merged in due to runing\n> aground the following problems:\n> \n> 1. There might be more than one link for one git repository.  One can\n>    provide git://, http:// and ssh:// URLs.  Which one to chose?\n> \n>    This issue might be solved by either using first one on the list,\n>    or filtering and showing link(s) to anonymous unauthenticated ones,\n>    i.e. _git_ link (if git:// URL exists) and perhaps _http_ link (if\n>    http:// URL exists).\n\nIf you are running a uniform enough site, http://git.kernel.org,\nhttp://git.fedorahosted.org/git/, etc it's easy enough to deal with.\nThis only becomes an issue if/when you allow more generic trees to\nexist, and aren't expecting a uniform git link.\n\n> 2. More important issue is that besides @git_base_url_list the URL or\n>    URLs for a repository can come from various other places: from\n>    'cloneurl' text file and from `gitweb.url' configuration variable.\n>    It it was taken into account (even to check that such configuration\n>    does not exist) it would badly affect performance of generating\n>    projects list page.\n> \n>    The git.kernel.org gitweb doesn't have this problem because it uses\n>    @git_base_url_list (I think unconditionally); also it supports\n>    output caching, so eventual performance hit is migitated.\n\nWe actually don't, at least currently, use @git_base_url_list.  Right\nnow there's a configuration variable to set a uniform server / base url,\nand then use project path to append to that.  git:// in this case is\nhard coded, though with http being smart now there is no reason why that\nshould be that way (no one has asked for the change &/or submitted a\npatch to me to alter that behavior).\n\nThe caching helps, though since I'm not actually using @git_base_url the\ncaching isn't of significant impact, since I only need to know the path\nvs. poking in the repo directly.  (that said caching still buys me a lot\nof performance overall).\n\nAssuming you are using my caching version of gitweb setting $gitlinkurl\nin your config file to be the base (before the path) of your link, it\nshould work.  Should get that even if caching is disabled, though YMMV I\ndon't do a lot of testing with the cache turned off, and I haven't\nwritten a test case for that yet.\n\n- John 'Warthog9' Hawley\n"},{"id":"153281","messageId":"201010120111.09436.jnareb@gmail.com","threadId":"25376","inReplyTo":"4CB3812B.8060209@eaglescrag.net","subject":"Re: Gitweb: Show git clone url on projects list","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-11T23:11:08Z","receivedAt":"2010-10-11T23:11:08Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 11 Oct 2010, J.H. wrote:\n> Sorry for the late response, was traveling on the 7th.  Comments inline.\n> \n> > There were multiple attempts to add such link to core gitweb (i.e. the\n> > one present in git 1.7.3), but were not merged in due to runing\n> > aground the following problems:\n> > \n> > 1. There might be more than one link for one git repository.  One can\n> >    provide git://, http:// and ssh:// URLs.  Which one to chose?\n> > \n> >    This issue might be solved by either using first one on the list,\n> >    or filtering and showing link(s) to anonymous unauthenticated ones,\n> >    i.e. _git_ link (if git:// URL exists) and perhaps _http_ link (if\n> >    http:// URL exists).\n> \n> If you are running a uniform enough site, http://git.kernel.org,\n> http://git.fedorahosted.org/git/, etc it's easy enough to deal with.\n> This only becomes an issue if/when you allow more generic trees to\n> exist, and aren't expecting a uniform git link.\n\nThe issue is that solution in core gitweb (as opposed to local version)\nshould be generic enough.  Is supporting single link per repository\ngeneric enough?\n\n> > 2. More important issue is that besides @git_base_url_list the URL or\n> >    URLs for a repository can come from various other places: from\n> >    'cloneurl' text file and from `gitweb.url' configuration variable.\n> >    It it was taken into account (even to check that such configuration\n> >    does not exist) it would badly affect performance of generating\n> >    projects list page.\n> > \n> >    The git.kernel.org gitweb doesn't have this problem because it uses\n> >    @git_base_url_list (I think unconditionally); also it supports\n> >    output caching, so eventual performance hit is migitated.\n> \n> We actually don't, at least currently, use @git_base_url_list.  Right\n> now there's a configuration variable to set a uniform server / base url,\n> and then use project path to append to that.  git:// in this case is\n> hard coded, though with http being smart now there is no reason why that\n> should be that way (no one has asked for the change &/or submitted a\n> patch to me to alter that behavior).\n\nWell, @git_base_url_list by default is empty or is single-element list\nfilled using GITWEB_BASE_URL build time configuration variable.  The\nURL or URLs for a repository are composed of elements of @git_base_url_list\nconcatenated with project name; in most common non-empty case it would be\n\n  \"$git_base_url_list[0]/$project\"\n\nwhile, from what I understand, the solution used by http://git.kernel.org\nis\n\n  \"git://$gitlinkurl/$project\"\n\nNot much difference.\n \n> The caching helps, though since I'm not actually using @git_base_url the\n> caching isn't of significant impact, since I only need to know the path\n> vs. poking in the repo directly.  (that said caching still buys me a lot\n> of performance overall).\n> \n> Assuming you are using my caching version of gitweb setting $gitlinkurl\n> in your config file to be the base (before the path) of your link, it\n> should work.  Should get that even if caching is disabled, though YMMV I\n> don't do a lot of testing with the cache turned off, and I haven't\n> written a test case for that yet.\n\nCaching is not necessary when using only @git_base_url_list, but is\nnecessary when project URLs can come from $projectroot/$project/cloneurl\nfile, or from `gitweb.url` repository config.  And even if they are not\nset, if they can be used, we have to check them.\n\nThe solution might be to specify somehow that only @git_base_url_list\n(or even only $git_base_url_list[0]) is to be taken into account when\ngenerating _git_ links on project list page.\n\n-- \nJakub Narebski\nPoland\n"}]}