# for smart git http access
# repos are at /Groups/dav so need access to that dir
# Allow some access 
SetEnv GIT_PROJECT_ROOT /Groups/dav/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /opt/local/libexec/git-core/git-http-backend/
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER  #IMportant

<Directory "/Groups/dav/git">
        Order allow,deny
        Allow from all
#Important! Lets apache execute the script!
		Options +ExecCGI -Includes 
        AllowOverride None
</Directory>
# need to access /opt/local for git script
<Directory "/opt/local/libexec/git-core/git-http-backend/">
        Order allow,deny
        Allow from all
		Options +ExecCGI -Includes
        AllowOverride None
</Directory>

<LocationMatch "^/git/.*/git-receive-pack$">
        AuthType Basic
        AuthName "Git Access"
        <Limit GET HEAD OPTIONS CONNECT POST PROPFIND PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                Require group  svnrw
        </Limit>
</LocationMatch>

# This pattern matches git operations and passes them to http-backend
#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))$" \
#        /opt/git/libexec/git-core/git-http-backend/$1
# Anything not matched above goes to displayable gitweb interface
#ScriptAlias /git /opt/git/cgi-bin/gitweb.cgi/


