{"thread":{"id":"19949","subject":"[PATCH] gitweb/README: fix AliasMatch in example","startedAt":"2009-06-27T16:24:11Z","lastAt":"2009-06-27T16:24:11Z","messageCount":1,"participants":["Giuseppe Bilotta"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"117097","messageId":"1246119851-22154-1-git-send-email-giuseppe.bilotta@gmail.com","threadId":"19949","inReplyTo":null,"subject":"[PATCH] gitweb/README: fix AliasMatch in example","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2009-06-27T16:24:11Z","receivedAt":"2009-06-27T16:24:11Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"When combining \"dumb client\" and human-friendly access by using the\n'.git' extension to switch between the two, make sure the AliasMatch\ncovers the entire request. Without a full match, a request for\n\nhttp://git.example.com/project/shortlog/branch..gitsomething\n\nwould result in a 404 because the server would try to access the\nthe project 'project/shortlog/branch.'\n\nThe solution is still not bulletproof, so document the possible failing\ncase.\n\nSigned-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n gitweb/README |   10 +++++++++-\n 1 files changed, 9 insertions(+), 1 deletions(-)\n\nI got bitten by this myself, hence the quick patch.\n\ndiff --git a/gitweb/README b/gitweb/README\nindex ccda890..9056d1e 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -377,7 +377,7 @@ named without a .git extension (e.g. /pub/git/project instead of\n \n \tDocumentRoot /var/www/gitweb\n \n-\tAliasMatch ^(/.*?)(\\.git)(/.*)? /pub/git$1$3\n+\tAliasMatch ^(/.*?)(\\.git)(/.*)?$ /pub/git$1$3\n \t<Directory /var/www/gitweb>\n \t\tOptions ExecCGI\n \t\tAddHandler cgi-script cgi\n@@ -402,6 +402,14 @@ http://git.example.com/project\n \n will provide human-friendly gitweb access.\n \n+This solution is not 100% bulletproof, in the sense that if some project\n+has a named ref (branch, tag) starting with 'git/', then paths such as\n+\n+http://git.example.com/project/command/abranch..git/abranch\n+\n+will fail with a 404 error.\n+\n+\n \n Originally written by:\n   Kay Sievers <kay.sievers@vrfy.org>\n-- \n1.6.3.rc1.192.gdbfcb\n"}]}