Skip to content

Commit

Permalink
gitweb/README: fix AliasMatch in example
Browse files Browse the repository at this point in the history
When combining "dumb client" and human-friendly access by using the
'.git' extension to switch between the two, make sure the AliasMatch
covers the entire request. Without a full match, a request for

http://git.example.com/project/shortlog/branch..gitsomething

would result in a 404 because the server would try to access the
the project 'project/shortlog/branch.'

The solution is still not bulletproof, so document the possible failing
case.

Signed-off-by: Giuseppe Bilotta <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Oblomov authored and gitster committed Jun 27, 2009
1 parent 0f70504 commit 1bed73c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gitweb/README
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ named without a .git extension (e.g. /pub/git/project instead of

DocumentRoot /var/www/gitweb

AliasMatch ^(/.*?)(\.git)(/.*)? /pub/git$1$3
AliasMatch ^(/.*?)(\.git)(/.*)?$ /pub/git$1$3
<Directory /var/www/gitweb>
Options ExecCGI
AddHandler cgi-script cgi
Expand All @@ -402,6 +402,14 @@ http://git.example.com/project

will provide human-friendly gitweb access.

This solution is not 100% bulletproof, in the sense that if some project
has a named ref (branch, tag) starting with 'git/', then paths such as

http://git.example.com/project/command/abranch..git/abranch

will fail with a 404 error.



Originally written by:
Kay Sievers <[email protected]>
Expand Down

0 comments on commit 1bed73c

Please sign in to comment.