Skip to content

Commit 1bed73c

Browse files
Oblomovgitster
authored andcommitted
gitweb/README: fix AliasMatch in example
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]>
1 parent 0f70504 commit 1bed73c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gitweb/README

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ named without a .git extension (e.g. /pub/git/project instead of
377377

378378
DocumentRoot /var/www/gitweb
379379

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

403403
will provide human-friendly gitweb access.
404404

405+
This solution is not 100% bulletproof, in the sense that if some project
406+
has a named ref (branch, tag) starting with 'git/', then paths such as
407+
408+
http://git.example.com/project/command/abranch..git/abranch
409+
410+
will fail with a 404 error.
411+
412+
405413

406414
Originally written by:
407415
Kay Sievers <[email protected]>

0 commit comments

Comments
 (0)