||This page is about Git support in Launchpad's Code Hosting component. Please [[Help|ask for help]] right away if you have any questions. || = Git hosting = Launchpad is gaining direct [[https://help.launchpad.net/Code/Git|Git hosting support]] alongside its existing Bazaar hosting support. This page provides some basic orientation to developers intending to work on this, along the same lines as [[Code]]. The major subsystems involved are: * The [[http://git-scm.com/|git client]] * Hosting service * The underlying object model * The web application * Repository source code browser == The git client == This is what users install on their systems to use Git. It is also installed on the hosting backend to support the `receive-pack` and `upload-pack` protocols. == Hosting service == The outside world connects to the Git hosting service using one of several protocols: || Scheme || Authentication || Supports private repositories || Can push || || `git://` || none || no || no || || `git+ssh://` || required (SSH) || yes || yes || || `https://` || none yet || not yet || not yet || The Git "dumb" HTTP transport will not be supported, as it has largely been considered deprecated since the provision of "smart" HTTP transport in Git v1.6.6 (released January, 2010). At present HTTPS support is rather basic; it will become more useful once we add access tokens (for the git client) and Open``ID integration (for cgit). SSL is terminated by haproxy for HTTPS, and all the other protocols also pass through haproxy for load balancing (although at the moment we only have a single backend). The underlying protocol endpoints live in [[https://code.launchpad.net/+branch/turnip|lp:turnip]], which invokes `git upload-pack` and `git receive-pack` to implement the git protocol itself. `turnip` also provides an internal API used by the Launchpad web application to manipulate and inspect repositories; and in turn the Launchpad web application provides an internal XML-RPC interface used by `turnip` to translate logical repository paths to filesystem paths and to notify Launchpad of repository changes. `turnip` is deployed using [[https://jujucharms.com/|Juju]], using the [[https://code.launchpad.net/~canonical-launchpad-branches/charms/trusty/turnip/devel|turnip charm]]. We deploy the stock [[https://jujucharms.com/gunicorn/trusty|gunicorn charm]] as a subordinate to help to publish the internal API service. == The web application == Code that is executed as part of the Launchpad web application. Major features: * general information * listings for various registry objects - people, teams, projects, packages * default repositories for projects and packages * privacy == Repository source code browser == Launchpad uses the external [[http://git.zx2c4.com/cgit/about/|cgit]] project to provide a web view of the repository contents. This is invoked by `turnip` when it receives HTTPS requests that don't correspond to git's smart HTTP protocol, and `turnip` deals with configuring `cgit` appropriately for each repository. cgit is currently only set up to serve public repositories. This will change once we have an Open``ID consumer in place so that we can use SSO authentication. Unlike typical cgit deployments, there is no global index of repositories, partly because it would be enormous and partly because it would be very difficult to do sensibly while also taking privacy into consideration. We currently use the stock cgit package from Ubuntu vivid, copied into the [[https://launchpad.net/~launchpad/+archive/ubuntu/ppa|Launchpad PPA]] and rebuilt for trusty.