{"thread":{"id":"21625","subject":"Make Gitweb behave like Apache mod_userdir","startedAt":"2009-11-15T10:04:03Z","lastAt":"2009-11-18T00:16:47Z","messageCount":18,"participants":["Sylvain Rabot","Junio C Hamano","Jakub Narebski","J.H."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127599","messageId":"7fce93be0911150204h259b7424md251c54186d05b7d@mail.gmail.com","threadId":"21625","inReplyTo":null,"subject":"Make Gitweb behave like Apache mod_userdir","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2009-11-15T10:04:03Z","receivedAt":"2009-11-15T10:04:03Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"Hello,\n\nI contact you because I spent quite some time to make something pretty\nbasic with gitweb.\nI made gitweb behave a bit like UserDir module will in apache.\nIn fact it's only configuration but I think it could be useful to others.\n\nBasicly it allows users of your server who use git to be able to use\ngitweb to browse their own root project. E.G. :\n\nAlice's private repos :\n\n/home/alice/git/product_a.git (cloned from /var/git/product_a.git)\n/home/alice/git/product_b.git (cloned from /var/git/product_b.git)\n/home/alice/git/product_c.git (cloned from /var/git/product_c.git)\n\nAlice's links to her repos which she wants to be able to browse with gitweb :\n\n/home/alice/gitweb/product_a -> /home/alice/git/product_a.git/.git\n/home/alice/gitweb/product_c -> /home/alice/git/product_c.git/.git\n\nBare repos :\n\n/var/git/product_a.git\n/var/git/product_b.git\n/var/git/product_c.git\n/var/git/product_d.git\n\n/etc/gitweb.conf :\n\n$projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/var/git/\";\n\nApache configuration :\n\nRewriteRule ^/~([^\\/]+)/?$  /cgi-bin/gitweb.cgi\n[QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n\nSo now all users with a gitweb folder in their home will be able to\nbrowse all git repos in it through http://<host>/~<user>.\n\nYou will find a patch enclosed which try to describe best what I did\nand why in the gitweb/README.\n\nRegards.\n\n\ndiff --git a/gitweb/README b/gitweb/README\nindex 66c6a93..6f733e6 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -306,8 +306,10 @@ repositories, you can configure apache like this:\n     DocumentRoot /pub/git\n     SetEnv\tGITWEB_CONFIG\t/etc/gitweb.conf\n     RewriteEngine on\n+\n     # make the front page an internal rewrite to the gitweb script\n     RewriteRule ^/$  /cgi-bin/gitweb.cgi\n+\n     # make access for \"dumb clients\" work\n     RewriteRule ^/(.*\\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]\n </VirtualHost>\n@@ -332,6 +334,20 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:\n   $my_uri = \"/\";\n   $home_link = \"/\";\n \n+If you want gitweb to act a bit like UserDir mod in apache, knowing, http://<host>/~<user> \n+will list all git repos of <user> located in a special directory in his home (/home/<user>/gitweb/), \n+do the following steps :\n+\n+Add this to the VirtualHost section of your apache configuration file :\n+\n+   RewriteRule ^/~([^\\/]+)/?$  /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n+\n+Modify your gitweb.conf file, located at /etc/gitweb.conf in this example, with :\n+\n+   $projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/path/to/the/defaul/project/root\"; \n+\n+Thus, each user with a gitweb folder in his home will be able to browse it with gitweb.\n+/!\\ The gitweb folder and user's home folder must be readable by the webserver user.\n \n PATH_INFO usage\n -----------------------\n"},{"id":"127635","messageId":"7vskcffqkn.fsf@alter.siamese.dyndns.org","threadId":"21625","inReplyTo":"7fce93be0911150204h259b7424md251c54186d05b7d@mail.gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-15T21:03:52Z","receivedAt":"2009-11-15T21:03:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Rabot <sylvain@abstraction.fr> writes:\n\n> I made gitweb behave a bit like UserDir module will in apache.\n> In fact it's only configuration but I think it could be useful to others.\n\nThanks.  Any comment from gitweb gangs?\n\n> Basicly it allows users of your server who use git to be able to use\n> gitweb to browse their own root project. E.G. :\n>\n> Alice's private repos :\n>\n> /home/alice/git/product_a.git (cloned from /var/git/product_a.git)\n> /home/alice/git/product_b.git (cloned from /var/git/product_b.git)\n> /home/alice/git/product_c.git (cloned from /var/git/product_c.git)\n>\n> Alice's links to her repos which she wants to be able to browse with gitweb :\n>\n> /home/alice/gitweb/product_a -> /home/alice/git/product_a.git/.git\n> /home/alice/gitweb/product_c -> /home/alice/git/product_c.git/.git\n>\n> Bare repos :\n>\n> /var/git/product_a.git\n> /var/git/product_b.git\n> /var/git/product_c.git\n> /var/git/product_d.git\n>\n> /etc/gitweb.conf :\n>\n> $projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/var/git/\";\n>\n> Apache configuration :\n>\n> RewriteRule ^/~([^\\/]+)/?$ /cgi-bin/gitweb.cgi\n> [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n>\n> So now all users with a gitweb folder in their home will be able to\n> browse all git repos in it through http://<host>/~<user>.\n>\n> You will find a patch enclosed which try to describe best what I did\n> and why in the gitweb/README.\n"},{"id":"127763","messageId":"200911171458.56047.jnareb@gmail.com","threadId":"21625","inReplyTo":"7vskcffqkn.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-11-17T13:58:55Z","receivedAt":"2009-11-17T13:58:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sun, 15 Nov 2009, Junio C Hamano wrote:\n> Sylvain Rabot <sylvain@abstraction.fr> writes:\n> \n> > I made gitweb behave a bit like UserDir module will in apache.\n> > In fact it's only configuration but I think it could be useful to others.\n> \n> Thanks.  Any comment from gitweb gangs?\n\nI would respond earlier if it was submitted with patch inline in mail\nbody, and not attached.  If it needs to be attached (because of MUA/MTA\nlinewrapping or encoding issues), it should use 8bit and not base64\ncontent transfer encoding, have 'text/plain' and not \n'application/octet-stream' content type, and \"inline\" and not \"attachement\"\nin content disposition.\n\nIt also lacks proper commit message (although email describes it quite\nwell) and signoff, as per Documentation/SubmittingPatches.\n\nI like this patch.  More examples in gitweb/README are always good idea.\n\n> > Basicly it allows users of your server who use git to be able to use\n\n\"Basically\"\n\n> > gitweb to browse their own root project. E.G. :\n\n\"For example\"\n\n> >\n> > Alice's private repos :\n> >\n> > /home/alice/git/product_a.git (cloned from /var/git/product_a.git)\n> > /home/alice/git/product_b.git (cloned from /var/git/product_b.git)\n> > /home/alice/git/product_c.git (cloned from /var/git/product_c.git)\n> >\n> > Alice's links to her repos which she wants to be able to browse with gitweb :\n\n\"Alice links\", or \"Alice creates symbolic links\"\n\n> >\n> > /home/alice/gitweb/product_a -> /home/alice/git/product_a.git/.git\n> > /home/alice/gitweb/product_c -> /home/alice/git/product_c.git/.git\n> >\n> > Bare repos :\n> >\n> > /var/git/product_a.git\n> > /var/git/product_b.git\n> > /var/git/product_c.git\n> > /var/git/product_d.git\n\nThe description is a bit lacking.  Where user should put theirs git\nrepositories, or symbolic links to git repositories?  How it would\nlook like in gitweb?\n\n-- \nJakub Narebski\nPoland\n"},{"id":"127764","messageId":"7fce93be0911170751r6d51ae7bn20fd593741b3eba6@mail.gmail.com","threadId":"21625","inReplyTo":"200911171458.56047.jnareb@gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2009-11-17T15:51:26Z","receivedAt":"2009-11-17T15:51:26Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"On Tue, Nov 17, 2009 at 14:58, Jakub Narebski <jnareb@gmail.com> wrote:\n> On Sun, 15 Nov 2009, Junio C Hamano wrote:\n>> Sylvain Rabot <sylvain@abstraction.fr> writes:\n>>\n>> > I made gitweb behave a bit like UserDir module will in apache.\n>> > In fact it's only configuration but I think it could be useful to others.\n>>\n>> Thanks.  Any comment from gitweb gangs?\n>\n> I would respond earlier if it was submitted with patch inline in mail\n> body, and not attached.  If it needs to be attached (because of MUA/MTA\n> linewrapping or encoding issues), it should use 8bit and not base64\n> content transfer encoding, have 'text/plain' and not\n> 'application/octet-stream' content type, and \"inline\" and not \"attachement\"\n> in content disposition.\n\nSorry about that but I'm new in the git world and it is the first time\nI submit a patch.\n\n> It also lacks proper commit message (although email describes it quite\n> well) and signoff, as per Documentation/SubmittingPatches.\n>\n> I like this patch.  More examples in gitweb/README are always good idea.\n>\n>> > Basicly it allows users of your server who use git to be able to use\n>\n> \"Basically\"\n\nOops\n\n>\n>> > gitweb to browse their own root project. E.G. :\n>\n> \"For example\"\n>\n>> >\n>> > Alice's private repos :\n>> >\n>> > /home/alice/git/product_a.git (cloned from /var/git/product_a.git)\n>> > /home/alice/git/product_b.git (cloned from /var/git/product_b.git)\n>> > /home/alice/git/product_c.git (cloned from /var/git/product_c.git)\n>> >\n>> > Alice's links to her repos which she wants to be able to browse with gitweb :\n>\n> \"Alice links\", or \"Alice creates symbolic links\"\n>\n>> >\n>> > /home/alice/gitweb/product_a -> /home/alice/git/product_a.git/.git\n>> > /home/alice/gitweb/product_c -> /home/alice/git/product_c.git/.git\n>> >\n>> > Bare repos :\n>> >\n>> > /var/git/product_a.git\n>> > /var/git/product_b.git\n>> > /var/git/product_c.git\n>> > /var/git/product_d.git\n>\n> The description is a bit lacking.  Where user should put theirs git\n> repositories, or symbolic links to git repositories?\n\nAs I said It's only configuration so It depends of your server\narchitecture. If admin of the server decides he allows users to browse\nvia gitweb their private/public repos which are linked in\n/home/*/.gitweb or anything else he has to modify the environmental\nvariable in the rewrite rule according to his wish.\n\n> How it would look like in gitweb?\n\nWhat do you mean ?\n\n> --\n> Jakub Narebski\n> Poland\n"},{"id":"127768","messageId":"200911171912.40658.jnareb@gmail.com","threadId":"21625","inReplyTo":"7fce93be0911170751r6d51ae7bn20fd593741b3eba6@mail.gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-11-17T18:12:39Z","receivedAt":"2009-11-17T18:12:39Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Tue, 17 Nov 2009, Sylvain Rabot wrote:\n> On Tue, Nov 17, 2009 at 14:58, Jakub Narebski <jnareb@gmail.com> wrote:\n\n> > The description is a bit lacking.  Where user should put theirs git\n> > repositories, or symbolic links to git repositories?\n> \n> As I said It's only configuration so It depends of your server\n> architecture. If admin of the server decides he allows users to browse\n> via gitweb their private/public repos which are linked in\n> /home/*/.gitweb or anything else he has to modify the environmental\n> variable in the rewrite rule according to his wish.\n\nSo in described configuration, to make repository visible user would have\nto put repository, or symbolic link to repository (or .git/ directory of\nthe repository) in ~/gitweb/ directory (just like one would need to put\nHTML files in ~/public_html/ or ~/WWW/ to have them visible as web site),\nisn't it?\n\n> > How it would look like in gitweb?\n> \n> What do you mean ?\n\nHow would example gitweb URL to repository look like?\n\n-- \nJakub Narebski\nPoland\n"},{"id":"127772","messageId":"7fce93be0911171156h3af4c7e6i93407db5bcab7059@mail.gmail.com","threadId":"21625","inReplyTo":"200911171912.40658.jnareb@gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2009-11-17T19:56:11Z","receivedAt":"2009-11-17T19:56:11Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"On Tue, Nov 17, 2009 at 19:12, Jakub Narebski <jnareb@gmail.com> wrote:\n> On Tue, 17 Nov 2009, Sylvain Rabot wrote:\n>> On Tue, Nov 17, 2009 at 14:58, Jakub Narebski <jnareb@gmail.com> wrote:\n>\n>> > The description is a bit lacking.  Where user should put theirs git\n>> > repositories, or symbolic links to git repositories?\n>>\n>> As I said It's only configuration so It depends of your server\n>> architecture. If admin of the server decides he allows users to browse\n>> via gitweb their private/public repos which are linked in\n>> /home/*/.gitweb or anything else he has to modify the environmental\n>> variable in the rewrite rule according to his wish.\n>\n> So in described configuration, to make repository visible user would have\n> to put repository, or symbolic link to repository (or .git/ directory of\n> the repository) in ~/gitweb/ directory (just like one would need to put\n> HTML files in ~/public_html/ or ~/WWW/ to have them visible as web site),\n> isn't it?\n>\n\nThat's right.\n\n>> > How it would look like in gitweb?\n>>\n>> What do you mean ?\n>\n> How would example gitweb URL to repository look like?\n\nhttp://repo.or.cz/ -> list the main GITWEB_PROJECTROOT (e.g.: /pub/scm)\nhttp://repo.or.cz/~user -> list /home/user/gitweb\nhttp://repo.or.cz/~user2 -> list /home/user2/gitweb\n...\n\n>\n> --\n> Jakub Narebski\n> Poland\n>\n"},{"id":"127773","messageId":"7vhbssewm7.fsf@alter.siamese.dyndns.org","threadId":"21625","inReplyTo":"7fce93be0911150204h259b7424md251c54186d05b7d@mail.gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-17T20:15:28Z","receivedAt":"2009-11-17T20:15:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Rabot <sylvain@abstraction.fr> writes:\n\n> +If you want gitweb to act a bit like UserDir mod in apache, knowing, http://<host>/~<user> \n> +will list all git repos of <user> located in a special directory in his home (/home/<user>/gitweb/), \n> +do the following steps :\n> +\n> +Add this to the VirtualHost section of your apache configuration file :\n> +\n> +   RewriteRule ^/~([^\\/]+)/?$  /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n> +\n> +Modify your gitweb.conf file, located at /etc/gitweb.conf in this example, with :\n> +\n> +   $projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/path/to/the/defaul/project/root\"; \n> +\n> +Thus, each user with a gitweb folder in his home will be able to browse it with gitweb.\n> +/!\\ The gitweb folder and user's home folder must be readable by the webserver user.\n\nWouldn't it be a good idea to somehow make this work well together with\nthe --user-path feature of git-daemon?\n\nPerhaps the recommended name given in the example shouldn't be ~/gitweb,\nbut more like ~/public_git, as this is like ~/public_html but for git\nrepositories.  Then the end users will browse\n\n\thttp://my.site/~gitster/public_git/git.git\n\nand gitweb can be told to show\n\n\tclone URL: git://my.site/~gitster/public_git/git.git\n\non the page.  If the site administrator runs git-daemon with --user-path\nset to public_git, everything will work seamlessly, no?\n"},{"id":"127774","messageId":"7fce93be0911171224r1cfc438ay7b38b81646154a23@mail.gmail.com","threadId":"21625","inReplyTo":"7vhbssewm7.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2009-11-17T20:24:54Z","receivedAt":"2009-11-17T20:24:54Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"On Tue, Nov 17, 2009 at 21:15, Junio C Hamano <gitster@pobox.com> wrote:\n> Sylvain Rabot <sylvain@abstraction.fr> writes:\n>\n>> +If you want gitweb to act a bit like UserDir mod in apache, knowing, http://<host>/~<user>\n>> +will list all git repos of <user> located in a special directory in his home (/home/<user>/gitweb/),\n>> +do the following steps :\n>> +\n>> +Add this to the VirtualHost section of your apache configuration file :\n>> +\n>> +   RewriteRule ^/~([^\\/]+)/?$  /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n>> +\n>> +Modify your gitweb.conf file, located at /etc/gitweb.conf in this example, with :\n>> +\n>> +   $projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/path/to/the/defaul/project/root\";\n>> +\n>> +Thus, each user with a gitweb folder in his home will be able to browse it with gitweb.\n>> +/!\\ The gitweb folder and user's home folder must be readable by the webserver user.\n>\n> Wouldn't it be a good idea to somehow make this work well together with\n> the --user-path feature of git-daemon?\n>\n> Perhaps the recommended name given in the example shouldn't be ~/gitweb,\n> but more like ~/public_git, as this is like ~/public_html but for git\n> repositories.  Then the end users will browse\n\nAs I said, it's configuration :)\n\n>\n>        http://my.site/~gitster/public_git/git.git\n>\n\nwould be http://my.site/~gitster/git.git\n\n> and gitweb can be told to show\n>\n>        clone URL: git://my.site/~gitster/public_git/git.git\n\nand git://my.site/~gitster/git.git\n\nif --user-path of git daemon set to public_git\n\n> on the page.  If the site administrator runs git-daemon with --user-path\n> set to public_git, everything will work seamlessly, no?\n>\n\nYes :)\n"},{"id":"127777","messageId":"7vd43gerak.fsf@alter.siamese.dyndns.org","threadId":"21625","inReplyTo":"7fce93be0911171224r1cfc438ay7b38b81646154a23@mail.gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-17T22:10:27Z","receivedAt":"2009-11-17T22:10:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Rabot <sylvain@abstraction.fr> writes:\n\n>> Wouldn't it be a good idea to somehow make this work well together with\n>> the --user-path feature of git-daemon?\n>>\n>> Perhaps the recommended name given in the example shouldn't be ~/gitweb,\n>> but more like ~/public_git, as this is like ~/public_html but for git\n>> repositories.  Then the end users will browse\n>\n> As I said, it's configuration :)\n\nWrong answer.\n\nExactly because it is configurable, the document that outlines the\nrecommended practice should suggest the best convention.  My point was\nthat it is likely to be tied to \"git\"-ness of the specified directory\nunder $HOME/, not limited to \"gitweb\"-ness, and it is wrong to recommend a\nname tied to \"gitweb\"-ness in this document.\n"},{"id":"127780","messageId":"7fce93be0911171454i61e995a1ob0bf80013bcb0727@mail.gmail.com","threadId":"21625","inReplyTo":"7vd43gerak.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2009-11-17T22:54:57Z","receivedAt":"2009-11-17T22:54:57Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"On Tue, Nov 17, 2009 at 23:10, Junio C Hamano <gitster@pobox.com> wrote:\n> Sylvain Rabot <sylvain@abstraction.fr> writes:\n>\n>>> Wouldn't it be a good idea to somehow make this work well together with\n>>> the --user-path feature of git-daemon?\n>>>\n>>> Perhaps the recommended name given in the example shouldn't be ~/gitweb,\n>>> but more like ~/public_git, as this is like ~/public_html but for git\n>>> repositories.  Then the end users will browse\n>>\n>> As I said, it's configuration :)\n>\n> Wrong answer.\n>\n\nAm I passing a test ?\n\n> Exactly because it is configurable, the document that outlines the\n> recommended practice should suggest the best convention.  My point was\n> that it is likely to be tied to \"git\"-ness of the specified directory\n> under $HOME/, not limited to \"gitweb\"-ness, and it is wrong to recommend a\n> name tied to \"gitweb\"-ness in this document.\n\nAgain, git is a brand new world for me and I don't know any of his\nconventions yet.\nI am not trying to impose my own conventions, I am just proposing an idea.\nIf you like it and want to make it more \"git world compliant\", please do so.\n"},{"id":"127781","messageId":"4B032AC8.4@eaglescrag.net","threadId":"21625","inReplyTo":"7vd43gerak.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"J.H.","fromEmail":"warthog19@eaglescrag.net","sentAt":"2009-11-17T22:59:20Z","receivedAt":"2009-11-17T22:59:20Z","isPatch":false,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"Junio C Hamano wrote:\n> Sylvain Rabot <sylvain@abstraction.fr> writes:\n> \n>>> Wouldn't it be a good idea to somehow make this work well together with\n>>> the --user-path feature of git-daemon?\n>>>\n>>> Perhaps the recommended name given in the example shouldn't be ~/gitweb,\n>>> but more like ~/public_git, as this is like ~/public_html but for git\n>>> repositories.  Then the end users will browse\n>> As I said, it's configuration :)\n> \n> Wrong answer.\n> \n> Exactly because it is configurable, the document that outlines the\n> recommended practice should suggest the best convention.  My point was\n> that it is likely to be tied to \"git\"-ness of the specified directory\n> under $HOME/, not limited to \"gitweb\"-ness, and it is wrong to recommend a\n> name tied to \"gitweb\"-ness in this document.\n\nFor starters I think overriding the /~<user> (specifically the ~ here) \nis going to be a bad idea no matter what you do and gives the wrong \nimpression about what / how the request is being responded to.  You \nmight want to try and pick a different delimiter or re-work the rule so \nthat you could have something like:\n\n\thttp://git.kernel.org/<gitweb urls>\n\thttp://git.kernel.org/user/<gitweb urls>\n\nYour also, likely, going to need to take into account things like \nindex.cgi and gitweb.cgi in the url as things like:\n\nhttp://git.kernel.org/?p=bluetooth/bluez-gnome.git;a=summary\nhttp://git.kernel.org/gitweb.cgi?p=bluetooth/bluez-gnome.git;a=summary\n\nare likely to be correct for almost all installations.\n\nI would agree with Junio on this, if your suggesting a possible practice \nyou should focus on the best convention.  Making it depend on something \nlike ~/gitweb doesn't make it clear or obvious enough to a user, or an \nadministrator, that the directory is being exported for the world to \nsee.  There is a reason it's called ~/public_html.\n\nKeep in mind most people are going to read the documentation and \ncopy/paste what they need and not change anything.\n\n\n\n- John 'Warthog9' Hawley\n"},{"id":"127784","messageId":"7v6398btz4.fsf@alter.siamese.dyndns.org","threadId":"21625","inReplyTo":"7fce93be0911171454i61e995a1ob0bf80013bcb0727@mail.gmail.com","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-17T23:40:47Z","receivedAt":"2009-11-17T23:40:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Rabot <sylvain@abstraction.fr> writes:\n\n> On Tue, Nov 17, 2009 at 23:10, Junio C Hamano <gitster@pobox.com> wrote:\n>> Sylvain Rabot <sylvain@abstraction.fr> writes:\n>>\n>>>> Wouldn't it be a good idea to somehow make this work well together with\n>>>> the --user-path feature of git-daemon?\n>>>>\n>>>> Perhaps the recommended name given in the example shouldn't be ~/gitweb,\n>>>> but more like ~/public_git, as this is like ~/public_html but for git\n>>>> repositories.  Then the end users will browse\n>>>\n>>> As I said, it's configuration :)\n>>\n>> Wrong answer.\n>\n> Am I passing a test ?\n\nSorry, but that wasn't what I meant.\n\n>> Exactly because it is configurable, the document that outlines the\n>> recommended practice should suggest the best convention.  My point was\n>> that it is likely to be tied to \"git\"-ness of the specified directory\n>> under $HOME/, not limited to \"gitweb\"-ness, and it is wrong to recommend a\n>> name tied to \"gitweb\"-ness in this document.\n>\n> Again, git is a brand new world for me and I don't know any of his\n> conventions yet.\n\nI do not see this as git-specific conventions.\n\nBut suggesting ~/gitweb is perfectly excusable, especially if you did not\nknow that git-daemon can respond to \"git://host/~user/\".\n\nJohn warthog19 (hmm, I thought he used to be warthog9) explained the above\nmuch better than I did.  People tend to cut and paste without thinking, so\nwe should describe a good default layout in our documentation.\n\n> I am not trying to impose my own conventions, I am just proposing an idea.\n\nYeah, I know.  We are all in this to improve things for people who follow\nus.\n"},{"id":"127785","messageId":"7vskccaf4q.fsf@alter.siamese.dyndns.org","threadId":"21625","inReplyTo":"4B032AC8.4@eaglescrag.net","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-17T23:46:45Z","receivedAt":"2009-11-17T23:46:45Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J.H.\" <warthog19@eaglescrag.net> writes:\n\n> For starters I think overriding the /~<user> (specifically the ~ here)\n> is going to be a bad idea no matter what you do and gives the wrong\n> impression about what / how the request is being responded to.  You\n> might want to try and pick a different delimiter or re-work the rule\n> so that you could have something like:\n>\n> \thttp://git.kernel.org/<gitweb urls>\n> \thttp://git.kernel.org/user/<gitweb urls>\n\nI am not objecting but showing my ignorance, but why is it a bad idea to\nallow\n\n\thttp://git.kernel.org/~junio/git.git\n\nto map to /home/junio/pubilic_git/git.git when\n\n\thttp://www.kernel.org/~junio/index.html\n\nmaps to /home/junio/public_html/index.html already?\n"},{"id":"127794","messageId":"4B033737.4090908@kernel.org","threadId":"21625","inReplyTo":"7v6398btz4.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"J.H.","fromEmail":"warthog9@kernel.org","sentAt":"2009-11-17T23:52:23Z","receivedAt":"2009-11-17T23:52:23Z","isPatch":false,"sender":{"key":"warthog9@kernel.org","avatar":"https://avatars.githubusercontent.com/u/2334704?v=4"},"body":"Junio C Hamano wrote:\n> Sylvain Rabot <sylvain@abstraction.fr> writes:\n> \n>> On Tue, Nov 17, 2009 at 23:10, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Sylvain Rabot <sylvain@abstraction.fr> writes:\n>>>\n>>>>> Wouldn't it be a good idea to somehow make this work well together with\n>>>>> the --user-path feature of git-daemon?\n>>>>>\n>>>>> Perhaps the recommended name given in the example shouldn't be ~/gitweb,\n>>>>> but more like ~/public_git, as this is like ~/public_html but for git\n>>>>> repositories.  Then the end users will browse\n>>>> As I said, it's configuration :)\n>>> Wrong answer.\n>> Am I passing a test ?\n> \n> Sorry, but that wasn't what I meant.\n> \n>>> Exactly because it is configurable, the document that outlines the\n>>> recommended practice should suggest the best convention.  My point was\n>>> that it is likely to be tied to \"git\"-ness of the specified directory\n>>> under $HOME/, not limited to \"gitweb\"-ness, and it is wrong to recommend a\n>>> name tied to \"gitweb\"-ness in this document.\n>> Again, git is a brand new world for me and I don't know any of his\n>> conventions yet.\n> \n> I do not see this as git-specific conventions.\n> \n> But suggesting ~/gitweb is perfectly excusable, especially if you did not\n> know that git-daemon can respond to \"git://host/~user/\".\n> \n> John warthog19 (hmm, I thought he used to be warthog9)\n\nYes I'm warthog9 (there's legacy reasons for warthog19 in the e-mail but \n- yeah)\n\n> explained the above\n> much better than I did.  People tend to cut and paste without thinking, so\n> we should describe a good default layout in our documentation.\n> \n>> I am not trying to impose my own conventions, I am just proposing an idea.\n> \n> Yeah, I know.  We are all in this to improve things for people who follow\n> us.\n\nThe biggest problem with the convention is not so much to impose our \nideas on people, but that people have a tendency to, like I said, \ncut/paste the first thing they come across and never change it.\n\nThis isn't a bash on implementers by any stretch of the imagination, \nit's just that most people are not going to be well versed in \ngit/gitweb, aren't going to understand some of the subtleties  and \naren't going to want to actually read the complexities in documentation. \n  So by recommending good, generic, defaults means that people will, by \ndefault, get a better result.\n\n- John 'Warthog9' Hawley\n"},{"id":"127786","messageId":"4B0338F9.9000608@eaglescrag.net","threadId":"21625","inReplyTo":"7vskccaf4q.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"J.H.","fromEmail":"warthog19@eaglescrag.net","sentAt":"2009-11-17T23:59:53Z","receivedAt":"2009-11-17T23:59:53Z","isPatch":false,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"Junio C Hamano wrote:\n> \"J.H.\" <warthog19@eaglescrag.net> writes:\n> \n>> For starters I think overriding the /~<user> (specifically the ~ here)\n>> is going to be a bad idea no matter what you do and gives the wrong\n>> impression about what / how the request is being responded to.  You\n>> might want to try and pick a different delimiter or re-work the rule\n>> so that you could have something like:\n>>\n>> \thttp://git.kernel.org/<gitweb urls>\n>> \thttp://git.kernel.org/user/<gitweb urls>\n> \n> I am not objecting but showing my ignorance, but why is it a bad idea to\n> allow\n> \n> \thttp://git.kernel.org/~junio/git.git\n> \n> to map to /home/junio/pubilic_git/git.git when\n> \n> \thttp://www.kernel.org/~junio/index.html\n> \n> maps to /home/junio/public_html/index.html already?\n\nI'm not objecting to the mapping, I'm objecting to the use of the ~ \nspecifically, since that's the default for mod_userdir - it's more or \nless a race condition waiting to happen with respect to does mod_rewrite \nget to and process it first or does mod_userdir.\n\nCase in point should:\n\nassuming that www.example.com (to get away from the specifics of \nkernel.org) is running gitweb but you also wanted to allow users to show \ntheir ~/public_html directories then\n\n\thttp://www.example.org/~junio/\n\ncould be ambiguous as to what should / is servicing the url.\n\nNow in reality it should work because of how apache is setup, but I \nwould argue it's a bad practice to overload the '~' designator like that \nfor use in gitweb specifically.\n\nIf you have mod_userdir disabled / not available this isn't an issue, \nbut making that assumption might be a bad idea.\n\n- John 'Warthog9' Hawley\n"},{"id":"127787","messageId":"4B03391A.90808@eaglescrag.net","threadId":"21625","inReplyTo":"7vskccaf4q.fsf@alter.siamese.dyndns.org","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"J.H.","fromEmail":"warthog19@eaglescrag.net","sentAt":"2009-11-18T00:00:26Z","receivedAt":"2009-11-18T00:00:26Z","isPatch":false,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"Junio C Hamano wrote:\n> \"J.H.\" <warthog19@eaglescrag.net> writes:\n> \n>> For starters I think overriding the /~<user> (specifically the ~ here)\n>> is going to be a bad idea no matter what you do and gives the wrong\n>> impression about what / how the request is being responded to.  You\n>> might want to try and pick a different delimiter or re-work the rule\n>> so that you could have something like:\n>>\n>> \thttp://git.kernel.org/<gitweb urls>\n>> \thttp://git.kernel.org/user/<gitweb urls>\n> \n> I am not objecting but showing my ignorance, but why is it a bad idea to\n> allow\n> \n> \thttp://git.kernel.org/~junio/git.git\n> \n> to map to /home/junio/pubilic_git/git.git when\n> \n> \thttp://www.kernel.org/~junio/index.html\n> \n> maps to /home/junio/public_html/index.html already?\n\nI'm not objecting to the mapping, I'm objecting to the use of the ~ \nspecifically, since that's the default for mod_userdir - it's more or \nless a race condition waiting to happen with respect to does mod_rewrite \nget to and process it first or does mod_userdir.\n\nCase in point should:\n\nassuming that www.example.com (to get away from the specifics of \nkernel.org) is running gitweb but you also wanted to allow users to show \ntheir ~/public_html directories then\n\n\thttp://www.example.org/~junio/\n\ncould be ambiguous as to what should / is servicing the url.\n\nNow in reality it should work because of how apache is setup, but I \nwould argue it's a bad practice to overload the '~' designator like that \nfor use in gitweb specifically.\n\nIf you have mod_userdir disabled / not available this isn't an issue, \nbut making that assumption might be a bad idea.\n\n- John 'Warthog9' Hawley\n"},{"id":"127789","messageId":"7vr5rw8zap.fsf@alter.siamese.dyndns.org","threadId":"21625","inReplyTo":"4B0338F9.9000608@eaglescrag.net","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-18T00:14:06Z","receivedAt":"2009-11-18T00:14:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J.H.\" <warthog19@eaglescrag.net> writes:\n\n> Junio C Hamano wrote:\n>\n>> I am not objecting but showing my ignorance, but why is it a bad idea to\n>> allow\n>>\n>> \thttp://git.kernel.org/~junio/git.git\n>>\n>> to map to /home/junio/pubilic_git/git.git when\n>>\n>> \thttp://www.kernel.org/~junio/index.html\n>>\n>> maps to /home/junio/public_html/index.html already?\n>\n> I'm not objecting to the mapping, I'm objecting to the use of the ~\n> specifically, since that's the default for mod_userdir - it's more or\n> less a race condition waiting to happen with respect to does\n> mod_rewrite get to and process it first or does mod_userdir.\n\nYeah, thanks for explaining it to me.  I realized the overlap between them\nimmediately after I sent the message out X-<.\n\n\thttp://site.xz/users/gitster/git.git\n\n(or anything that does not override \"~name\") sounds good to me.\n"},{"id":"127790","messageId":"7fce93be0911171616l4f41acd4v2a42d5849a139d29@mail.gmail.com","threadId":"21625","inReplyTo":"4B032AC8.4@eaglescrag.net","subject":"Re: Make Gitweb behave like Apache mod_userdir","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2009-11-18T00:16:47Z","receivedAt":"2009-11-18T00:16:47Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"> For starters I think overriding the /~<user> (specifically the ~ here) is\n> going to be a bad idea no matter what you do and gives the wrong impression\n> about what / how the request is being responded to.  You might want to try\n> and pick a different delimiter or re-work the rule so that you could have\n> something like:\n>\n>        http://git.kernel.org/<gitweb urls>\n>        http://git.kernel.org/user/<gitweb urls>\n>\n> Your also, likely, going to need to take into account things like index.cgi\n> and gitweb.cgi in the url as things like:\n>\n> http://git.kernel.org/?p=bluetooth/bluez-gnome.git;a=summary\n> http://git.kernel.org/gitweb.cgi?p=bluetooth/bluez-gnome.git;a=summary\n>\n\n<VirtualHost git.abstraction.fr:80>\n\n        ServerAdmin webmaster@abstraction.fr\n        ServerName git.abstraction.fr:80\n        DocumentRoot /var/www/sylvain/git.abstraction.fr/html\n\n        # Possible values include: debug, info, notice, warn, error, crit,\n        # alert, emerg.\n        LogLevel debug\n\n        CustomLog /var/www/sylvain/git.abstraction.fr/log/access.log combined\n        ErrorLog /var/www/sylvain/git.abstraction.fr/log/error.log\n        ServerSignature On\n\n        RewriteEngine on\n        RewriteLog /var/www/sylvain/git.abstraction.fr/log/rewrite.log\n        RewriteLogLevel 3\n        RewriteRule ^/$\n/cgi-bin/gitweb.cgi     [QSA,L,PT]\n        RewriteRule ^/gitweb.cgi$\n/cgi-bin/gitweb.cgi     [QSA,L,PT]\n        RewriteRule ^/\\~([^\\/]+)/?$\n/cgi-bin/gitweb.cgi\n[QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n        RewriteRule ^/\\~([^\\/]+)/gitweb.cgi$\n/cgi-bin/gitweb.cgi\n[QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n        RewriteRule ^/users/([^\\/]+)/?$\n/cgi-bin/gitweb.cgi\n[QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n        RewriteRule ^/users/([^\\/]+)/gitweb.cgi$\n/cgi-bin/gitweb.cgi\n[QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n\n        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/\n        <Directory \"/usr/lib/cgi-bin/\">\n                AllowOverride None\n                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n                Order allow,deny\n                Allow from all\n        </Directory>\n\n        Alias /gitweb /usr/share/gitweb/\n        <Directory \"/usr/share/gitweb/\">\n                AllowOverride None\n                Options +MultiViews +SymLinksIfOwnerMatch\n                Order allow,deny\n                Allow from all\n        </Directory>\n\n</VirtualHost>\n\n\nYou can test here :\n\nhttp://git.abstraction.fr/\nhttp://git.abstraction.fr/gitweb.cgi\nhttp://git.abstraction.fr/~sylvain/\nhttp://git.abstraction.fr/~sylvain/gitweb.cgi\nhttp://git.abstraction.fr/users/sylvain/\nhttp://git.abstraction.fr/users/sylvain/gitweb.cgi\n\nThe dns record is fresh. If your dns is not up to date the ip is 88.191.254.60.\n"}]}