]> asedeno.scripts.mit.edu Git - git.git/blobdiff - Documentation/git-http-backend.txt
Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint
[git.git] / Documentation / git-http-backend.txt
index 0b5e9515a1c7f246ee91c17cccc63a7f7080a80d..67aec067c8ffd75837ccc1d3e2524f5db2eb9a75 100644 (file)
@@ -29,6 +29,14 @@ SERVICES
 These services can be enabled/disabled using the per-repository
 configuration file:
 
+http.getanyfile::
+       This serves older Git clients which are unable to use the
+       upload pack service.  When enabled, clients are able to read
+       any file within the repository, including objects that are
+       no longer reachable from a branch but are still present.
+       It is enabled by default, but a repository can disable it
+       by setting this configuration item to `false`.
+
 http.uploadpack::
        This serves 'git-fetch-pack' and 'git-ls-remote' clients.
        It is enabled by default, but a repository can disable it
@@ -69,7 +77,7 @@ To enable anonymous read access but authenticated write access,
 require authorization with a LocationMatch directive:
 +
 ----------------------------------------------------------------
-<LocationMatch ".*/git-receive-pack$">
+<LocationMatch "^/git/.*/git-receive-pack$">
        AuthType Basic
        AuthName "Git Access"
        Require group committers
@@ -88,6 +96,23 @@ directive around the repository, or one of its parent directories:
        ...
 </Location>
 ----------------------------------------------------------------
++
+To serve gitweb at the same url, use a ScriptAliasMatch to only
+those URLs that 'git-http-backend' can handle, and forward the
+rest to gitweb:
++
+----------------------------------------------------------------
+ScriptAliasMatch \
+       "(?x)^/git/(.*/(HEAD | \
+                       info/refs | \
+                       objects/(info/[^/]+ | \
+                                [0-9a-f]{2}/[0-9a-f]{38} | \
+                                pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
+                       git-(upload|receive)-pack))$" \
+       /usr/libexec/git-core/git-http-backend/$1
+
+ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
+----------------------------------------------------------------
 
 Accelerated static Apache 2.x::
        Similar to the above, but Apache can be used to return static
@@ -98,13 +123,25 @@ Accelerated static Apache 2.x::
 ----------------------------------------------------------------
 SetEnv GIT_PROJECT_ROOT /var/www/git
 
-ScriptAlias /git/        /usr/libexec/git-core/git-http-backend/
-Alias       /git_static/ /var/www/git/
+AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$          /var/www/git/$1
+AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1
+ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
+----------------------------------------------------------------
++
+This can be combined with the gitweb configuration:
++
+----------------------------------------------------------------
+SetEnv GIT_PROJECT_ROOT /var/www/git
 
-RewriteEngine on
-RewriteRule ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$    /git_static/$1 [PT]
-RewriteRule ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.pack)$ /git_static/$1 [PT]
-RewriteRule ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.idx)$  /git_static/$1 [PT]
+AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$          /var/www/git/$1
+AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1
+ScriptAliasMatch \
+       "(?x)^/git/(.*/(HEAD | \
+                       info/refs | \
+                       objects/info/[^/]+ | \
+                       git-(upload|receive)-pack))$" \
+       /usr/libexec/git-core/git-http-backend/$1
+ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
 ----------------------------------------------------------------