git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cannot fetch arm git tree

From
JJ.H. <warthog19@eaglescrag.net>
Date
Jan 24, 2011, 07:34 UTC
Message-ID
<4D3D2B84.6090409@eaglescrag.net>
In-Reply-To
<4D3D2865.4020408@viscovery.net>
On 01/23/2011 11:21 PM, Johannes Sixt wrote:
Show 15 quoted lines
> Am 1/21/2011 15:50, schrieb Russell King - ARM Linux:
>>  SetEnv GIT_PROJECT_ROOT /var/www/git
>>  SetEnv GIT_HTTP_EXPORT_ALL
>>  ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
>>
>> Great.  Deciding that it will be http://servername.example.com/git/ is
>> really damned annoying as that's traditionally where gitweb lives,
>> which requires a different script alias.
>> ...
>> I'm really not interested in working out how to bodge this into working
>> along side the existing gitweb setup by adding lots of rewrite rules,...
> 
> It has been worked out for you already. It's just a single rule (although
> a bit longish). Look for 'ScriptAliasMatch' in
> http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html

I was going to say, I have both gitweb and smart http support running in parallel, it's not terribly complicated. The way I'm doing it is a bit older (mainly that long ScriptAliasMatch broken out more), but it's still only 11 lines to the apache config:

# Various environment setup, should be obvious SetEnv GIT_PROJECT_ROOT /path SetEnv GIT_HTTP_EXPORT_ALL 1 SetEnv GIT_EXEC_PATH /usr/libexec/git-core/

# Here so that we can do straight wget fetches for the objects files, # pack files and refs heads. # This isn't strictly neccisary, but if it's done we can use the inbuilt # sendfile() of apache for the sending of those files vs. funneling them # through the CGI AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /path/$1 AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /path/$1 AliasMatch ^/(.*/refs/heads/.*)$ /path/$1

# Meat of how to make this all work ScriptAliasMatch "^/(.*/HEAD)$" /usr/libexec/git-core/git-http-backend/path/$1 ScriptAliasMatch "^/(.*/info/refs)$" /usr/libexec/git-core/git-http-backend/path/$1 ScriptAliasMatch "^/(.*/objects/info/[^/]+)$" /usr/libexec/git-core/git-http-backend/path/$1 ScriptAliasMatch "^/pub/scm/(.*/git-upload-pack)$" /usr/libexec/git-core/git-http-backend/path/$1 ScriptAliasMatch "^/pub/scm/(.*/git-receive-pack)$" /usr/libexec/git-core/git-http-backend/path/$1

Just an example anyway, the paths have been shortened to fit e-mail better.
- John 'Warthog9' Hawley
Previous: Johannes SixtNext: Russell King - ARM Linux
Message 14 of 15 in “Re: cannot fetch arm git tree”
  1. Uwe Kleine-KönigJan 16, 2011
  2. Russell King - ARM LinuxJan 16, 2011
  3. Jello huangJan 17, 2011
  4. Detlef VollmannJan 21, 2011
  5. Uwe Kleine-KönigJan 21, 2011
  6. Russell King - ARM LinuxJan 21, 2011
  7. Detlef VollmannJan 21, 2011
  8. Jello huangJan 21, 2011
  9. Russell King - ARM LinuxJan 21, 2011
  10. Detlef VollmannJan 21, 2011
  11. Uwe Kleine-KönigJan 21, 2011
  12. Miles BaderJan 24, 2011
  13. Johannes SixtJan 24, 2011
  14. J.H.Jan 24, 2011
  15. Russell King - ARM LinuxJan 24, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.