* Gitweb: Scan dir for repos & show these other specified repos
@ 2010-03-01 19:15 Mike.lifeguard
2010-03-01 19:55 ` Jakub Narebski
0 siblings, 1 reply; 12+ messages in thread
From: Mike.lifeguard @ 2010-03-01 19:15 UTC (permalink / raw)
To: git
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
Is it possible to have gitweb show all repositories in /path/to/wherever
and also show some other repositories at particular locations like
/home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan
multiple dirs? Currently I can only see how to do one or the other
within a single gitweb installation. I suppose I could run two of them...
Thanks for the help.
- -Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkuMEmQACgkQst0AR/DaKHuYiQCeL3EoeUCr676lbwE2PIZK2tk3
7dsAoMpBmKoZZj3LV1zKLVqtIpFIiIii
=YDlg
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gitweb: Scan dir for repos & show these other specified repos
2010-03-01 19:15 Gitweb: Scan dir for repos & show these other specified repos Mike.lifeguard
@ 2010-03-01 19:55 ` Jakub Narebski
2010-03-01 21:20 ` Sylvain Rabot
0 siblings, 1 reply; 12+ messages in thread
From: Jakub Narebski @ 2010-03-01 19:55 UTC (permalink / raw)
To: Mike.lifeguard; +Cc: git
"Mike.lifeguard" <mike.lifeguard@gmail.com> writes:
> Is it possible to have gitweb show all repositories in /path/to/wherever
> and also show some other repositories at particular locations like
> /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan
> multiple dirs? Currently I can only see how to do one or the other
> within a single gitweb installation. I suppose I could run two of them...
It is not possible with $projects_list being directory (or undefined,
which means to take $projectroot), but I think it is possible with
$projects_list being a file.
You would have to set $projectroot to common prefix (it might be
empty, i.e. '' if there is no common prefix), then list there all
repositories, relative to $projectroot. See gitweb/README and
gitweb/INSTALL, and comments in gitweb.perl for details on file
format.
P.S. It probably be a good idea to have something like mod_userdir,
but gitweb currently doesn't support something like that.
P.P.S. Alternate solution would be to try to work around it with
automount / autofs or something like that.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gitweb: Scan dir for repos & show these other specified repos
2010-03-01 19:55 ` Jakub Narebski
@ 2010-03-01 21:20 ` Sylvain Rabot
2010-03-01 22:18 ` Jakub Narebski
0 siblings, 1 reply; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-01 21:20 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Mike.lifeguard, git
[-- Attachment #1: Type: text/plain, Size: 2121 bytes --]
On Mon, 2010-03-01 at 11:55 -0800, Jakub Narebski wrote:
> "Mike.lifeguard" <mike.lifeguard@gmail.com> writes:
>
> > Is it possible to have gitweb show all repositories in /path/to/wherever
> > and also show some other repositories at particular locations like
> > /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan
> > multiple dirs? Currently I can only see how to do one or the other
> > within a single gitweb installation. I suppose I could run two of them...
>
> It is not possible with $projects_list being directory (or undefined,
> which means to take $projectroot), but I think it is possible with
> $projects_list being a file.
>
> You would have to set $projectroot to common prefix (it might be
> empty, i.e. '' if there is no common prefix), then list there all
> repositories, relative to $projectroot. See gitweb/README and
> gitweb/INSTALL, and comments in gitweb.perl for details on file
> format.
>
>
> P.S. It probably be a good idea to have something like mod_userdir,
> but gitweb currently doesn't support something like that.
I had the same problematic some times ago. I wanted to have several
project's roots folder for gitweb (one for each unix user of the
server).
You can find the discussion here :
http://thread.gmane.org/gmane.comp.version-control.git/132926/
http://marc.info/?t=125827961600002&r=1&w=2
Here the configuration I used :
/etc/gitweb.conf :
$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/var/gitweb";
/etc/apache2/sites-available/yourvirtualhost :
RewriteEngine on
RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]
RewriteRule ^/\~([^\/]+)/?$ /cgi-bin/gitweb.cgi
[QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]
I.E. :
http://yourvirtualhost/ will have /var/gitweb as proeject root
http://yourvirtualhost/~<user>/ will have /home/<users>/gitweb as
proeject root
You can modify the rewrite rule to match what you want to do.
>
> P.P.S. Alternate solution would be to try to work around it with
> automount / autofs or something like that.
--
Sylvain Rabot <sylvain@abstraction.fr>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gitweb: Scan dir for repos & show these other specified repos
2010-03-01 21:20 ` Sylvain Rabot
@ 2010-03-01 22:18 ` Jakub Narebski
2010-03-01 22:22 ` Sylvain Rabot
2010-03-02 0:04 ` [PATCH] gitweb multiple project roots documentation Sylvain Rabot
0 siblings, 2 replies; 12+ messages in thread
From: Jakub Narebski @ 2010-03-01 22:18 UTC (permalink / raw)
To: Sylvain Rabot; +Cc: Mike.lifeguard, git
On Mon, 1 Mar 2010, Sylvain Rabot wrote:
> On Mon, 2010-03-01 at 11:55 -0800, Jakub Narebski wrote:
> > "Mike.lifeguard" <mike.lifeguard@gmail.com> writes:
> >
> > > Is it possible to have gitweb show all repositories in /path/to/wherever
> > > and also show some other repositories at particular locations like
> > > /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan
> > > multiple dirs? Currently I can only see how to do one or the other
> > > within a single gitweb installation. I suppose I could run two of them...
> > P.S. It probably be a good idea to have something like mod_userdir,
> > but gitweb currently doesn't support something like that.
>
> I had the same problematic some times ago. I wanted to have several
> project's roots folder for gitweb (one for each unix user of the
> server).
>
> You can find the discussion here :
>
> http://thread.gmane.org/gmane.comp.version-control.git/132926/
> http://marc.info/?t=125827961600002&r=1&w=2
>
> Here the configuration I used :
>
> /etc/gitweb.conf :
>
> $projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/var/gitweb";
>
> /etc/apache2/sites-available/yourvirtualhost :
>
> RewriteEngine on
> RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]
> RewriteRule ^/\~([^\/]+)/?$ /cgi-bin/gitweb.cgi
> [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]
>
> I.E. :
>
> http://yourvirtualhost/ will have /var/gitweb as proeject root
> http://yourvirtualhost/~<user>/ will have /home/<users>/gitweb as
> proeject root
>
> You can modify the rewrite rule to match what you want to do.
Would you mind writing it up and adding it as an example in gitweb/README?
If you don't have time, I can try to do this myself in my free time.
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gitweb: Scan dir for repos & show these other specified repos
2010-03-01 22:18 ` Jakub Narebski
@ 2010-03-01 22:22 ` Sylvain Rabot
2010-03-02 0:04 ` [PATCH] gitweb multiple project roots documentation Sylvain Rabot
1 sibling, 0 replies; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-01 22:22 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 2051 bytes --]
On Mon, 2010-03-01 at 23:18 +0100, Jakub Narebski wrote:
> On Mon, 1 Mar 2010, Sylvain Rabot wrote:
> > On Mon, 2010-03-01 at 11:55 -0800, Jakub Narebski wrote:
> > > "Mike.lifeguard" <mike.lifeguard@gmail.com> writes:
> > >
> > > > Is it possible to have gitweb show all repositories in /path/to/wherever
> > > > and also show some other repositories at particular locations like
> > > > /home/user/git/repo1 and /home/user2/git/repo2 ? Or better yet, scan
> > > > multiple dirs? Currently I can only see how to do one or the other
> > > > within a single gitweb installation. I suppose I could run two of them...
>
> > > P.S. It probably be a good idea to have something like mod_userdir,
> > > but gitweb currently doesn't support something like that.
> >
> > I had the same problematic some times ago. I wanted to have several
> > project's roots folder for gitweb (one for each unix user of the
> > server).
> >
> > You can find the discussion here :
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/132926/
> > http://marc.info/?t=125827961600002&r=1&w=2
> >
> > Here the configuration I used :
> >
> > /etc/gitweb.conf :
> >
> > $projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/var/gitweb";
> >
> > /etc/apache2/sites-available/yourvirtualhost :
> >
> > RewriteEngine on
> > RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]
> > RewriteRule ^/\~([^\/]+)/?$ /cgi-bin/gitweb.cgi
> > [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]
> >
> > I.E. :
> >
> > http://yourvirtualhost/ will have /var/gitweb as proeject root
> > http://yourvirtualhost/~<user>/ will have /home/<users>/gitweb as
> > proeject root
> >
> > You can modify the rewrite rule to match what you want to do.
>
> Would you mind writing it up and adding it as an example in gitweb/README?
> If you don't have time, I can try to do this myself in my free time.
Not at all. I will try to make it the more understandable possible and I
will send you the patch.
--
Sylvain Rabot <sylvain@abstraction.fr>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] gitweb multiple project roots documentation
2010-03-01 22:18 ` Jakub Narebski
2010-03-01 22:22 ` Sylvain Rabot
@ 2010-03-02 0:04 ` Sylvain Rabot
2010-03-02 0:38 ` Jakub Narebski
2010-03-10 18:55 ` [PATCH] gitweb readme fixed regarding per user project root repository Sylvain Rabot
1 sibling, 2 replies; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-02 0:04 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Sylvain Rabot
This commit adds in the gitweb/README file a description of how to use gitweb
with several project roots using apache virtualhost rewrite rules.
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
---
gitweb/README | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/gitweb/README b/gitweb/README
index 6c2c8e1..2e55d38 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -312,12 +312,16 @@ If you want to have one URL for both gitweb and your http://
repositories, you can configure apache like this:
<VirtualHost *:80>
- ServerName git.example.org
- DocumentRoot /pub/git
- SetEnv GITWEB_CONFIG /etc/gitweb.conf
+ ServerName git.example.org
+ DocumentRoot /pub/git
+ SetEnv GITWEB_CONFIG /etc/gitweb.conf
+
+ # turning on mod rewrite
RewriteEngine on
+
# make the front page an internal rewrite to the gitweb script
RewriteRule ^/$ /cgi-bin/gitweb.cgi
+
# make access for "dumb clients" work
RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
</VirtualHost>
@@ -343,6 +347,63 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:
$home_link = "/";
+Webserver configuration with multiple projects' root
+----------------------------------------------------
+
+If you want to use gitweb with several project roots you can edit your apache
+virtual host and gitweb.conf configuration files like this :
+
+virtual host configuration :
+
+<VirtualHost *:80>
+ ServerName git.example.org
+ DocumentRoot /pub/git
+ SetEnv GITWEB_CONFIG /etc/gitweb.conf
+
+ # turning on mod rewrite
+ RewriteEngine on
+
+ # make the front page an internal rewrite to the gitweb script
+ RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT]
+
+ # look for a public_git folder in unix users' home
+ # http://git.example.org/~<user>/
+ RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+
+ # http://git.example.org/+<user>/
+ #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+
+ # http://git.example.org/user/<user>/
+ #RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+
+ # defined list of project roots
+ RewriteRule ^/scm(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT]
+ RewriteRule ^/var(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]
+
+ # make access for "dumb clients" work
+ RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
+</VirtualHost>
+
+gitweb.conf configuration :
+
+$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/pub/git";
+
+These configurations enable two things. First, each unix user (<user>) of the
+server will be able to browse through gitweb git repositories found in
+~/public_git/ with the following url : http://git.example.org/~<user>/
+
+If you do not want this feature on your server just remove the second rewrite rule.
+
+If you already use mod_userdir in your virtual host or you don't want to use
+the '~' as first character just comment or remove the second rewrite rule and
+uncomment one of the following according to what you want.
+
+Second, repositories found in /pub/scm/ and /var/git/ will be accesible
+through http://git.example.org/scm/ and http://git.example.org/var/.
+You can add as many project roots as you want by adding rewrite rules like the
+third and the fourth.
+
+
PATH_INFO usage
-----------------------
If you enable PATH_INFO usage in gitweb by putting
--
1.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] gitweb multiple project roots documentation
2010-03-02 0:04 ` [PATCH] gitweb multiple project roots documentation Sylvain Rabot
@ 2010-03-02 0:38 ` Jakub Narebski
2010-03-10 18:55 ` [PATCH] gitweb readme fixed regarding per user project root repository Sylvain Rabot
1 sibling, 0 replies; 12+ messages in thread
From: Jakub Narebski @ 2010-03-02 0:38 UTC (permalink / raw)
To: Sylvain Rabot; +Cc: git
Sylvain Rabot wrote:
> This commit adds in the gitweb/README file a description of how to use gitweb
> with several project roots using apache virtualhost rewrite rules.
>
> Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
For what it is worth:
Acked-by: Jakub Narebski <jnareb@gmail.com>
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] gitweb readme fixed regarding per user project root repository
2010-03-02 0:04 ` [PATCH] gitweb multiple project roots documentation Sylvain Rabot
2010-03-02 0:38 ` Jakub Narebski
@ 2010-03-10 18:55 ` Sylvain Rabot
1 sibling, 0 replies; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-10 18:55 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Junio C Hamano, Sylvain Rabot
the RewriteRule involving the '+' character is not working as it is
replaced by a space in urls when you click on links.
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
---
gitweb/README | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gitweb/README b/gitweb/README
index ad6a04c..2acf595 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -347,18 +347,18 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:
$home_link = "/";
-Webserver configuration with multiple projects' root
+Webserver configuration with multiple projects roots
----------------------------------------------------
-If you want to use gitweb with several project roots you can edit your apache
-virtual host and gitweb.conf configuration files like this :
+If you want to use gitweb with several projects roots then you can edit your
+apache virtual host and gitweb.conf configuration files like this :
virtual host configuration :
<VirtualHost *:80>
ServerName git.example.org
DocumentRoot /pub/git
- SetEnv GITWEB_CONFIG /etc/gitweb.conf
+ SetEnv GITWEB_CONFIG /etc/gitweb.conf
# turning on mod rewrite
RewriteEngine on
@@ -370,8 +370,8 @@ virtual host configuration :
# http://git.example.org/~<user>/
RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
- # http://git.example.org/+<user>/
- #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+ # http://git.example.org/u/<user>/
+ #RewriteRule ^/u/([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
# http://git.example.org/user/<user>/
#RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
--
1.7.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] gitweb: readme fixed regarding per user project root repository
@ 2010-03-22 22:15 Sylvain Rabot
2010-03-22 22:15 ` Sylvain Rabot
0 siblings, 1 reply; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-22 22:15 UTC (permalink / raw)
To: git
This is a small modification of the patch I sent (Message-ID: <1267488297-10415-1-git-send-email-sylvain@abstraction.fr>) not yet applied, as far as I have seen.
It includes a fix for a rewrite rule wich was working but not useable, an update to make another one better and some typos fixes.
Regards.
--
Sylvain
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] gitweb: readme fixed regarding per user project root repository
2010-03-22 22:15 [PATCH] gitweb: " Sylvain Rabot
@ 2010-03-22 22:15 ` Sylvain Rabot
2010-03-26 18:52 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-22 22:15 UTC (permalink / raw)
To: git; +Cc: Sylvain Rabot
+ the RewriteRule '/+<user>' is not working as the '+' character is
replaced by a space in urls when you click on links. it is replaced by '/u/<user>'
+ the RewriteRule '/user/<user>' updated to allow
'/user/<user>', '/user/<user>/' and '/user/<user>/gitweb.cgi'
+ some typos fixed
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
---
gitweb/README | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gitweb/README b/gitweb/README
index ad6a04c..bc90f4d 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -347,18 +347,18 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:
$home_link = "/";
-Webserver configuration with multiple projects' root
-----------------------------------------------------
+Webserver configuration with multiple project roots
+---------------------------------------------------
-If you want to use gitweb with several project roots you can edit your apache
-virtual host and gitweb.conf configuration files like this :
+If you want to use gitweb with several project roots then you can edit your
+apache virtual host and gitweb.conf configuration files like this :
virtual host configuration :
<VirtualHost *:80>
- ServerName git.example.org
- DocumentRoot /pub/git
- SetEnv GITWEB_CONFIG /etc/gitweb.conf
+ ServerName git.example.org
+ DocumentRoot /pub/git
+ SetEnv GITWEB_CONFIG /etc/gitweb.conf
# turning on mod rewrite
RewriteEngine on
@@ -368,13 +368,13 @@ virtual host configuration :
# look for a public_git folder in unix users' home
# http://git.example.org/~<user>/
- RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+ RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
- # http://git.example.org/+<user>/
- #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+ # http://git.example.org/u/<user>/
+ #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
# http://git.example.org/user/<user>/
- #RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+ #RewriteRule ^/user/([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
# defined list of project roots
RewriteRule ^/scm(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT]
--
1.7.0.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] gitweb: readme fixed regarding per user project root repository
2010-03-22 22:15 ` Sylvain Rabot
@ 2010-03-26 18:52 ` Junio C Hamano
2010-03-29 20:43 ` Sylvain Rabot
0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2010-03-26 18:52 UTC (permalink / raw)
To: Sylvain Rabot; +Cc: git
I was waiting for gitweb people to respond, but nobody seems to be
interested so here is my take on it.
Sylvain Rabot <sylvain@abstraction.fr> writes:
> + the RewriteRule '/+<user>' is not working as the '+' character is
> replaced by a space in urls when you click on links. it is replaced by '/u/<user>'
I think the _only_ value of having this example, in addition to the next
one that uses "http://host/user/<me>" notation, was to demonstrate that
you do not necessarily have the actual user name and the magic token (be
it "user" or "u") that introduces the per-user hierarchy as separate path
components delimited with a slash. Changing "+<me>" to "u/<me>" removes
that only additional value from this example.
Anybody moderately intelligent would be able to guess "u/<me>" if she
finds "user/<me>" too long to her taste, so I would suggest updating the
example to allow "http://host/+<user>/" but spell the rewrite rule in such
a way that actually does work. An alternative is to just remove it.
By the way, does mod-rewrite configuration allow "~<me>" (home-directory
expansion) when setting the environment? You currently do:
E=GITWEB_PROJECTROOT:/home/$1/public_git/
but if we somehow could write it like
E=GITWEB_PROJECTROOT:~$1/public_git/
it would be more generally useful, no?
> + the RewriteRule '/user/<user>' updated to allow
> '/user/<user>', '/user/<user>/' and '/user/<user>/gitweb.cgi'
Please describe what you added relative to the original, not just what the
final result looks like. "updated to allow A B C" doesn't tell the reader
"it used to redirect only A and C to gitweb request, but B wasn't
rewritten.", which seems to be the case if I am reading your regexp
correctly. Describing why it is better to also rewrite B would be a good
idea, too, if it is not obvious.
> + some typos fixed
>
> Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
> diff --git a/gitweb/README b/gitweb/README
> index ad6a04c..bc90f4d 100644
> --- a/gitweb/README
> +++ b/gitweb/README
> @@ -347,18 +347,18 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:
> $home_link = "/";
>
>
> -Webserver configuration with multiple projects' root
> -----------------------------------------------------
> +Webserver configuration with multiple project roots
> +---------------------------------------------------
Ok.
> -If you want to use gitweb with several project roots you can edit your apache
> -virtual host and gitweb.conf configuration files like this :
> +If you want to use gitweb with several project roots then you can edit your
> +apache virtual host and gitweb.conf configuration files like this :
Ok (you might want to remove SP before colon, though).
> virtual host configuration :
>
> <VirtualHost *:80>
> - ServerName git.example.org
> - DocumentRoot /pub/git
> - SetEnv GITWEB_CONFIG /etc/gitweb.conf
> + ServerName git.example.org
> + DocumentRoot /pub/git
> + SetEnv GITWEB_CONFIG /etc/gitweb.conf
What is this reindentation for? "Just cosmetic" is an acceptable answer
as long as the change resulted in cosmetic improvement, but it doesn't
seem to be cosmetic improvement, either.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gitweb: readme fixed regarding per user project root repository
2010-03-26 18:52 ` Junio C Hamano
@ 2010-03-29 20:43 ` Sylvain Rabot
0 siblings, 0 replies; 12+ messages in thread
From: Sylvain Rabot @ 2010-03-29 20:43 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 4354 bytes --]
On Fri, 2010-03-26 at 11:52 -0700, Junio C Hamano wrote:
> I was waiting for gitweb people to respond, but nobody seems to be
> interested so here is my take on it.
>
> Sylvain Rabot <sylvain@abstraction.fr> writes:
>
> > + the RewriteRule '/+<user>' is not working as the '+' character is
> > replaced by a space in urls when you click on links. it is replaced by '/u/<user>'
>
> I think the _only_ value of having this example, in addition to the next
> one that uses "http://host/user/<me>" notation, was to demonstrate that
> you do not necessarily have the actual user name and the magic token (be
> it "user" or "u") that introduces the per-user hierarchy as separate path
> components delimited with a slash. Changing "+<me>" to "u/<me>" removes
> that only additional value from this example.
>
> Anybody moderately intelligent would be able to guess "u/<me>" if she
> finds "user/<me>" too long to her taste, so I would suggest updating the
> example to allow "http://host/+<user>/" but spell the rewrite rule in such
> a way that actually does work. An alternative is to just remove it.
>
The problem is http://host/+user works but then, when you click on a
link you will be redirected to :
"http://host/ user?p=git/git.git;a=tree"
-------------^
I will try to look into gitweb.perl to see if the url encoding can be
updated smoothly without breaking anything to accept the '+' otherwise I
think removing this example would be the right decision like you
suggested.
> By the way, does mod-rewrite configuration allow "~<me>" (home-directory
> expansion) when setting the environment? You currently do:
>
> E=GITWEB_PROJECTROOT:/home/$1/public_git/
>
> but if we somehow could write it like
>
> E=GITWEB_PROJECTROOT:~$1/public_git/
>
> it would be more generally useful, no?
I looked and I don't think so, ~user/public_git/ is not evaluated by
apache. Maybe it possible to evaluate it in the perl side, I will look
into it also.
>
> > + the RewriteRule '/user/<user>' updated to allow
> > '/user/<user>', '/user/<user>/' and '/user/<user>/gitweb.cgi'
>
> Please describe what you added relative to the original, not just what the
> final result looks like. "updated to allow A B C" doesn't tell the reader
> "it used to redirect only A and C to gitweb request, but B wasn't
> rewritten.", which seems to be the case if I am reading your regexp
> correctly. Describing why it is better to also rewrite B would be a good
> idea, too, if it is not obvious.
Will do.
>
> > + some typos fixed
> >
> > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
>
> > diff --git a/gitweb/README b/gitweb/README
> > index ad6a04c..bc90f4d 100644
> > --- a/gitweb/README
> > +++ b/gitweb/README
> > @@ -347,18 +347,18 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:
> > $home_link = "/";
> >
> >
> > -Webserver configuration with multiple projects' root
> > -----------------------------------------------------
> > +Webserver configuration with multiple project roots
> > +---------------------------------------------------
>
> Ok.
>
> > -If you want to use gitweb with several project roots you can edit your apache
> > -virtual host and gitweb.conf configuration files like this :
> > +If you want to use gitweb with several project roots then you can edit your
> > +apache virtual host and gitweb.conf configuration files like this :
>
> Ok (you might want to remove SP before colon, though).
My bad, French habit, but, according to wikipedia it is also English
"compliant" (http://en.wikipedia.org/wiki/Colon_%28punctuation%
29#Spacing). As you want.
>
> > virtual host configuration :
> >
> > <VirtualHost *:80>
> > - ServerName git.example.org
> > - DocumentRoot /pub/git
> > - SetEnv GITWEB_CONFIG /etc/gitweb.conf
> > + ServerName git.example.org
> > + DocumentRoot /pub/git
> > + SetEnv GITWEB_CONFIG /etc/gitweb.conf
>
> What is this reindentation for? "Just cosmetic" is an acceptable answer
> as long as the change resulted in cosmetic improvement, but it doesn't
> seem to be cosmetic improvement, either.
That was the case, it looked better in vim.
>
> Thanks.
--
Sylvain Rabot <sylvain@abstraction.fr>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-03-29 20:43 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01 19:15 Gitweb: Scan dir for repos & show these other specified repos Mike.lifeguard
2010-03-01 19:55 ` Jakub Narebski
2010-03-01 21:20 ` Sylvain Rabot
2010-03-01 22:18 ` Jakub Narebski
2010-03-01 22:22 ` Sylvain Rabot
2010-03-02 0:04 ` [PATCH] gitweb multiple project roots documentation Sylvain Rabot
2010-03-02 0:38 ` Jakub Narebski
2010-03-10 18:55 ` [PATCH] gitweb readme fixed regarding per user project root repository Sylvain Rabot
-- strict thread matches above, loose matches on Subject: below --
2010-03-22 22:15 [PATCH] gitweb: " Sylvain Rabot
2010-03-22 22:15 ` Sylvain Rabot
2010-03-26 18:52 ` Junio C Hamano
2010-03-29 20:43 ` Sylvain Rabot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).