{"thread":{"id":"22869","subject":"Gitweb: Scan dir for repos & show these other specified repos","startedAt":"2010-03-01T19:15:51Z","lastAt":"2010-03-10T18:55:29Z","messageCount":8,"participants":["Mike.lifeguard","Jakub Narebski","Sylvain Rabot"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"135966","messageId":"4B8C1267.2050301@gmail.com","threadId":"22869","inReplyTo":null,"subject":"Gitweb: Scan dir for repos & show these other specified repos","fromName":"Mike.lifeguard","fromEmail":"mike.lifeguard@gmail.com","sentAt":"2010-03-01T19:15:51Z","receivedAt":"2010-03-01T19:15:51Z","isPatch":false,"sender":{"key":"mike.lifeguard@gmail.com","avatar":"https://gravatar.com/avatar/a12ecdf9f8b0f34d981d1ae8d7e74205358548f48936c86f240308e942544928?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHello,\n\nIs it possible to have gitweb show all repositories in /path/to/wherever\nand also show some other repositories at particular locations like\n/home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan\nmultiple dirs? Currently I can only see how to do one or the other\nwithin a single gitweb installation. I suppose I could run two of them...\n\nThanks for the help.\n\n- -Mike\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n\niEYEARECAAYFAkuMEmQACgkQst0AR/DaKHuYiQCeL3EoeUCr676lbwE2PIZK2tk3\n7dsAoMpBmKoZZj3LV1zKLVqtIpFIiIii\n=YDlg\n-----END PGP SIGNATURE-----\n"},{"id":"135969","messageId":"m33a0jn7ft.fsf@localhost.localdomain","threadId":"22869","inReplyTo":"4B8C1267.2050301@gmail.com","subject":"Re: Gitweb: Scan dir for repos & show these other specified repos","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-01T19:55:54Z","receivedAt":"2010-03-01T19:55:54Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Mike.lifeguard\" <mike.lifeguard@gmail.com> writes:\n\n> Is it possible to have gitweb show all repositories in /path/to/wherever\n> and also show some other repositories at particular locations like\n> /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan\n> multiple dirs? Currently I can only see how to do one or the other\n> within a single gitweb installation. I suppose I could run two of them...\n\nIt is not possible with $projects_list being directory (or undefined,\nwhich means to take $projectroot), but I think it is possible with\n$projects_list being a file.\n\nYou would have to set $projectroot to common prefix (it might be\nempty, i.e. '' if there is no common prefix), then list there all\nrepositories, relative to $projectroot.  See gitweb/README and\ngitweb/INSTALL, and comments in gitweb.perl for details on file\nformat.\n\n\nP.S. It probably be a good idea to have something like mod_userdir,\nbut gitweb currently doesn't support something like that.\n\nP.P.S. Alternate solution would be to try to work around it with\nautomount / autofs or something like that.\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"135973","messageId":"1267478419.4400.2.camel@kheops","threadId":"22869","inReplyTo":"m33a0jn7ft.fsf@localhost.localdomain","subject":"Re: Gitweb: Scan dir for repos & show these other specified repos","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-03-01T21:20:19Z","receivedAt":"2010-03-01T21:20:19Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"On Mon, 2010-03-01 at 11:55 -0800, Jakub Narebski wrote:\n> \"Mike.lifeguard\" <mike.lifeguard@gmail.com> writes:\n> \n> > Is it possible to have gitweb show all repositories in /path/to/wherever\n> > and also show some other repositories at particular locations like\n> > /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan\n> > multiple dirs? Currently I can only see how to do one or the other\n> > within a single gitweb installation. I suppose I could run two of them...\n> \n> It is not possible with $projects_list being directory (or undefined,\n> which means to take $projectroot), but I think it is possible with\n> $projects_list being a file.\n> \n> You would have to set $projectroot to common prefix (it might be\n> empty, i.e. '' if there is no common prefix), then list there all\n> repositories, relative to $projectroot.  See gitweb/README and\n> gitweb/INSTALL, and comments in gitweb.perl for details on file\n> format.\n> \n> \n> P.S. It probably be a good idea to have something like mod_userdir,\n> but gitweb currently doesn't support something like that.\n\nI had the same problematic some times ago. I wanted to have several\nproject's roots folder for gitweb (one for each unix user of the\nserver).\n\nYou can find the discussion here :\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/132926/\nhttp://marc.info/?t=125827961600002&r=1&w=2\n\nHere the configuration I used :\n\n/etc/gitweb.conf :\n\n$projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/var/gitweb\";\n\n/etc/apache2/sites-available/yourvirtualhost :\n\nRewriteEngine on\nRewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]\nRewriteRule ^/\\~([^\\/]+)/?$ /cgi-bin/gitweb.cgi\n[QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n\nI.E. :\n\nhttp://yourvirtualhost/ will have /var/gitweb as proeject root\nhttp://yourvirtualhost/~<user>/ will have /home/<users>/gitweb as\nproeject root\n\nYou can modify the rewrite rule to match what you want to do.\n\n> \n> P.P.S. Alternate solution would be to try to work around it with\n> automount / autofs or something like that.\n\n\n-- \nSylvain Rabot <sylvain@abstraction.fr>\n"},{"id":"135987","messageId":"201003012318.29548.jnareb@gmail.com","threadId":"22869","inReplyTo":"1267478419.4400.2.camel@kheops","subject":"Re: Gitweb: Scan dir for repos & show these other specified repos","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-01T22:18:28Z","receivedAt":"2010-03-01T22:18:28Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 1 Mar 2010, Sylvain Rabot wrote:\n> On Mon, 2010-03-01 at 11:55 -0800, Jakub Narebski wrote:\n> > \"Mike.lifeguard\" <mike.lifeguard@gmail.com> writes:\n> > \n> > > Is it possible to have gitweb show all repositories in /path/to/wherever\n> > > and also show some other repositories at particular locations like\n> > > /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan\n> > > multiple dirs? Currently I can only see how to do one or the other\n> > > within a single gitweb installation. I suppose I could run two of them...\n\n> > P.S. It probably be a good idea to have something like mod_userdir,\n> > but gitweb currently doesn't support something like that.\n> \n> I had the same problematic some times ago. I wanted to have several\n> project's roots folder for gitweb (one for each unix user of the\n> server).\n> \n> You can find the discussion here :\n> \n> http://thread.gmane.org/gmane.comp.version-control.git/132926/\n> http://marc.info/?t=125827961600002&r=1&w=2\n> \n> Here the configuration I used :\n> \n> /etc/gitweb.conf :\n> \n> $projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/var/gitweb\";\n> \n> /etc/apache2/sites-available/yourvirtualhost :\n> \n> RewriteEngine on\n> RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]\n> RewriteRule ^/\\~([^\\/]+)/?$ /cgi-bin/gitweb.cgi\n> [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n> \n> I.E. :\n> \n> http://yourvirtualhost/ will have /var/gitweb as proeject root\n> http://yourvirtualhost/~<user>/ will have /home/<users>/gitweb as\n> proeject root\n> \n> You can modify the rewrite rule to match what you want to do.\n\nWould you mind writing it up and adding it as an example in gitweb/README?\nIf you don't have time, I can try to do this myself in my free time.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"135988","messageId":"1267482172.4400.22.camel@kheops","threadId":"22869","inReplyTo":"201003012318.29548.jnareb@gmail.com","subject":"Re: Gitweb: Scan dir for repos & show these other specified repos","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-03-01T22:22:52Z","receivedAt":"2010-03-01T22:22:52Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"On Mon, 2010-03-01 at 23:18 +0100, Jakub Narebski wrote:\n> On Mon, 1 Mar 2010, Sylvain Rabot wrote:\n> > On Mon, 2010-03-01 at 11:55 -0800, Jakub Narebski wrote:\n> > > \"Mike.lifeguard\" <mike.lifeguard@gmail.com> writes:\n> > > \n> > > > Is it possible to have gitweb show all repositories in /path/to/wherever\n> > > > and also show some other repositories at particular locations like\n> > > > /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan\n> > > > multiple dirs? Currently I can only see how to do one or the other\n> > > > within a single gitweb installation. I suppose I could run two of them...\n> \n> > > P.S. It probably be a good idea to have something like mod_userdir,\n> > > but gitweb currently doesn't support something like that.\n> > \n> > I had the same problematic some times ago. I wanted to have several\n> > project's roots folder for gitweb (one for each unix user of the\n> > server).\n> > \n> > You can find the discussion here :\n> > \n> > http://thread.gmane.org/gmane.comp.version-control.git/132926/\n> > http://marc.info/?t=125827961600002&r=1&w=2\n> > \n> > Here the configuration I used :\n> > \n> > /etc/gitweb.conf :\n> > \n> > $projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/var/gitweb\";\n> > \n> > /etc/apache2/sites-available/yourvirtualhost :\n> > \n> > RewriteEngine on\n> > RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]\n> > RewriteRule ^/\\~([^\\/]+)/?$ /cgi-bin/gitweb.cgi\n> > [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]\n> > \n> > I.E. :\n> > \n> > http://yourvirtualhost/ will have /var/gitweb as proeject root\n> > http://yourvirtualhost/~<user>/ will have /home/<users>/gitweb as\n> > proeject root\n> > \n> > You can modify the rewrite rule to match what you want to do.\n> \n> Would you mind writing it up and adding it as an example in gitweb/README?\n> If you don't have time, I can try to do this myself in my free time.\n\nNot at all. I will try to make it the more understandable possible and I\nwill send you the patch.\n\n\n-- \nSylvain Rabot <sylvain@abstraction.fr>\n"},{"id":"135992","messageId":"1267488297-10415-1-git-send-email-sylvain@abstraction.fr","threadId":"22869","inReplyTo":"201003012318.29548.jnareb@gmail.com","subject":"[PATCH] gitweb multiple project roots documentation","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-03-02T00:04:57Z","receivedAt":"2010-03-02T00:04:57Z","isPatch":true,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"This commit adds in the gitweb/README file a description of how to use gitweb\nwith several project roots using apache virtualhost rewrite rules.\n\nSigned-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n---\n gitweb/README |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 64 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/README b/gitweb/README\nindex 6c2c8e1..2e55d38 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -312,12 +312,16 @@ If you want to have one URL for both gitweb and your http://\n repositories, you can configure apache like this:\n \n <VirtualHost *:80>\n-    ServerName git.example.org\n-    DocumentRoot /pub/git\n-    SetEnv\tGITWEB_CONFIG\t/etc/gitweb.conf\n+    ServerName\t\tgit.example.org\n+    DocumentRoot\t/pub/git\n+    SetEnv\t\t\tGITWEB_CONFIG\t/etc/gitweb.conf\n+\n+    # turning on mod rewrite\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@@ -343,6 +347,63 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:\n   $home_link = \"/\";\n \n \n+Webserver configuration with multiple projects' root\n+----------------------------------------------------\n+\n+If you want to use gitweb with several project roots you can edit your apache\n+virtual host and gitweb.conf configuration files like this :\n+\n+virtual host configuration :\n+\n+<VirtualHost *:80>\n+    ServerName\t\t\tgit.example.org\n+    DocumentRoot\t\t/pub/git\n+    SetEnv\t\t\t\tGITWEB_CONFIG\t/etc/gitweb.conf\n+\n+    # turning on mod rewrite\n+    RewriteEngine on\n+\n+    # make the front page an internal rewrite to the gitweb script\n+    RewriteRule ^/$ \t\t/cgi-bin/gitweb.cgi [QSA,L,PT]\n+\n+    # look for a public_git folder in unix users' home\n+    # http://git.example.org/~<user>/\n+    RewriteRule ^/\\~([^\\/]+)(/|/gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n+\n+    # http://git.example.org/+<user>/\n+    #RewriteRule ^/\\+([^\\/]+)(/|/gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n+\n+    # http://git.example.org/user/<user>/\n+    #RewriteRule ^/user/([^\\/]+)/(gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n+\n+    # defined list of project roots\n+    RewriteRule ^/scm(/|/gitweb.cgi)?$\t\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT]\n+    RewriteRule ^/var(/|/gitweb.cgi)?$\t\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]\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+\n+gitweb.conf configuration :\n+\n+$projectroot = $ENV{'GITWEB_PROJECTROOT'} || \"/pub/git\";\n+\n+These configurations enable two things. First, each unix user (<user>) of the\n+server will be able to browse through gitweb git repositories found in\n+~/public_git/ with the following url : http://git.example.org/~<user>/\n+\n+If you do not want this feature on your server just remove the second rewrite rule.\n+\n+If you already use mod_userdir in your virtual host or you don't want to use \n+the '~' as first character just comment or remove the second rewrite rule and \n+uncomment one of the following according to what you want.\n+\n+Second, repositories found in /pub/scm/ and /var/git/ will be accesible\n+through http://git.example.org/scm/ and http://git.example.org/var/.\n+You can add as many project roots as you want by adding rewrite rules like the\n+third and the fourth.\n+\n+\n PATH_INFO usage\n -----------------------\n If you enable PATH_INFO usage in gitweb by putting\n-- \n1.7.0\n"},{"id":"135995","messageId":"201003020138.22657.jnareb@gmail.com","threadId":"22869","inReplyTo":"1267488297-10415-1-git-send-email-sylvain@abstraction.fr","subject":"Re: [PATCH] gitweb multiple project roots documentation","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-02T00:38:18Z","receivedAt":"2010-03-02T00:38:18Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Sylvain Rabot wrote:\n\n> This commit adds in the gitweb/README file a description of how to use gitweb\n> with several project roots using apache virtualhost rewrite rules.\n> \n> Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n\nFor what it is worth:\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\n-- \nJakub Narebski\nPoland\n"},{"id":"136533","messageId":"1268247329-8174-1-git-send-email-sylvain@abstraction.fr","threadId":"22869","inReplyTo":"1267488297-10415-1-git-send-email-sylvain@abstraction.fr","subject":"[PATCH] gitweb readme fixed regarding per user project root repository","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-03-10T18:55:29Z","receivedAt":"2010-03-10T18:55:29Z","isPatch":true,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"the RewriteRule involving the '+' character is not working as it is\nreplaced by a space in urls when you click on links.\n\nSigned-off-by: Sylvain Rabot <sylvain@abstraction.fr>\n---\n gitweb/README |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/gitweb/README b/gitweb/README\nindex ad6a04c..2acf595 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -347,18 +347,18 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:\n   $home_link = \"/\";\n \n \n-Webserver configuration with multiple projects' root\n+Webserver configuration with multiple projects roots\n ----------------------------------------------------\n \n-If you want to use gitweb with several project roots you can edit your apache\n-virtual host and gitweb.conf configuration files like this :\n+If you want to use gitweb with several projects roots then you can edit your\n+apache virtual host and gitweb.conf configuration files like this :\n \n virtual host configuration :\n \n <VirtualHost *:80>\n     ServerName\t\t\tgit.example.org\n     DocumentRoot\t\t/pub/git\n-    SetEnv\t\t\t\tGITWEB_CONFIG\t/etc/gitweb.conf\n+    SetEnv\t\t\tGITWEB_CONFIG\t/etc/gitweb.conf\n \n     # turning on mod rewrite\n     RewriteEngine on\n@@ -370,8 +370,8 @@ virtual host configuration :\n     # http://git.example.org/~<user>/\n     RewriteRule ^/\\~([^\\/]+)(/|/gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n \n-    # http://git.example.org/+<user>/\n-    #RewriteRule ^/\\+([^\\/]+)(/|/gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n+    # http://git.example.org/u/<user>/\n+    #RewriteRule ^/u/([^\\/]+)(/|/gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n \n     # http://git.example.org/user/<user>/\n     #RewriteRule ^/user/([^\\/]+)/(gitweb.cgi)?$\t/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]\n-- \n1.7.0\n"}]}