dvdotsenko / git_http_backend.py

Port of git's "Smart HTTP" (git-http-backend) server component to Python WSGI interface.
git_http_backend_python_wsgi
GNU Lesser General Public License v2.1
72 stars 15 forks source link

git_http_backend.py - Git "Smart HTTP" (git-http-backend) server implementation in Python for WSGI server architecture.

About git-http-backend:

A special "Smart HTTP" git-specific RPC implementation allowing one to push data to remote repo and pull data from remote repo in a very efficient way, over regular HTTP (using POSTs and GETs)

"Smart HTTP" RPC support was introduced in git client starting with v.1.6.6.

The essense of "Smart HTTP" RPC is that it's a transport for communication between client and server's git-upload-pack and git-receive-pack - the commands ran on server when client, respectively, "pulls" and "pushes."

"Screen-scraped" raw outputs of the commands are gzipped and are sent around as HTTP POSTs / replies. Some RPC-specific control strings and HTTP headers are introduced into communication stream to signal to git client that server supports "Smart HTTP" Client signals to the server that it supports "Smart HTTP" by talking over HTTP POST (vs. GET)

PRC supports Basic Auth over HTTP and rudimentary, server-side (not file-system-side) ACL features.

There is no published documentation on the RPC protocol. Per direct, personal inquiry with the author of the protocol and code I confirmed that the only published "documentaion" is the comment-less C code in the Git repo proper.

About this project:

The project is largely a translation of similar effort done in Ruby, called Grack - http://github.com/schacon/grack - by Scott Chacon schacon@gmail.com et al. (This readme file is modeled on the readme file in Grack)

This project aims to supplement the C-based git-http-backend CGI handler distributed in mainline Git with a Python WSGI-compatible application.

The default git-http-backend only runs under CGI on Apache. Furthermore, Git packagesbinaries containing http-backend.cgi are not availableon Windows (as of May 18, 2010. Checked in Cygwin).

Python, WSGI-based git-http-backend implementation may run on practically any server, on almost any OS. Look for server-specific WSGI modules or wrap WSGI app into a Fast/S/CGI. At the most basic level, the application can be ran against Python's built-in WSGI server.

Since there is no published documentation on Git's "Smart HTTP" RPC protocol, this implementation is largely a guess of how it works based on my reading of original C and Grack's Ruby code.

Dependencies

Installation

See Examples folter.

License

See file named COPYING.LESSER for license terms governing over the entire project.

(Some, explisitely labeled so constituent files/works are licensed under separate, more-permissive terms. See disclaimers at the start of the files for details.)

This file is covered by the following copyright and permission notice(s): /*