module documentation
Git smart network protocol server implementation.
For more detailed implementation on the network protocol, see the Documentation/technical directory in the cgit distribution, and in particular:
- Documentation/technical/protocol-capabilities.txt
- Documentation/technical/pack-protocol.txt
Currently supported capabilities:
- include-tag
- thin-pack
- multi_ack_detailed
- multi_ack
- side-band-64k
- ofs-delta
- no-progress
- report-status
- delete-refs
- shallow
- symref
Class |
|
A backend for the Git smart server implementation. |
Class |
|
Repository abstraction used by the Git server. |
Class |
|
Trivial backend that looks up Git repositories in a dictionary. |
Class |
|
Simple backend looking up Git repositories in the local file system. |
Class |
|
Smart protocol command handler base class. |
Class |
|
Graph walker implementation speaking the multi-ack-detailed protocol. |
Class |
|
Graph walker implementation that speaks the multi-ack protocol. |
Class |
|
Protocol handler for packs. |
Class |
|
Protocol handler for downloading a pack from the client. |
Class |
|
Graph walker implementation that speaks the single-ack protocol. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Protocol handler for uploading a pack to the client. |
Function | generate |
Generate an info refs file. |
Function | generate |
Generate an index for for packs. |
Function | main |
Entry point for starting a TCP git server. |
Function | serve |
Serve a single command. |
Function | update |
Generate server info for dumb file access. |
Constant | DEFAULT |
Undocumented |
Variable | logger |
Undocumented |
Class | _ |
A graph walker that knows the git protocol. |
Function | _all |
Check whether all the current wants are satisfied by a set of haves. |
Function | _find |
Find shallow commits according to a given depth. |
Function | _split |
Split a line read from the wire. |
Function | _want |
Undocumented |
Constant | _GRAPH |
Undocumented |
Serve a single command.
This is mostly useful for the implementation of commands used by e.g. git+ssh.
Returns: Exit code for use with sys.exit. 0 on success, 1 on failure.
Parameters | |
handler | Handler class to use for the request |
argv | execv-style command-line arguments. Defaults to sys.argv. |
backend | Backend to use |
inf | File-like object to read from, defaults to standard input. |
outf | File-like object to write to, defaults to standard output. |
Generate server info for dumb file access.
This generates info/refs and objects/info/packs, similar to "git update-server-info".
DEFAULT_HANDLERS =
¶
Undocumented
Value |
|
Check whether all the current wants are satisfied by a set of haves.
- Note: Wants are specified with set_wants rather than passed in since
- in the current interface they are determined outside this class.
Parameters | |
store | Object store to retrieve objects from |
haves | A set of commits we know the client has. |
wants | A set of commits the client wants |
Find shallow commits according to a given depth.
- Returns: A tuple of (shallow, not_shallow), sets of SHAs that should be
- considered shallow and unshallow according to the arguments. Note that these sets may overlap if a commit is reachable along multiple paths.
Parameters | |
store | An ObjectStore for looking up objects. |
heads | Iterable of head SHAs to start walking from. |
depth | The depth of ancestors to include. A depth of one includes only the heads themselves. |
Split a line read from the wire.
- Returns: a tuple having one of the following forms:
- ('want', obj_id) ('have', obj_id) ('done', None) (None, None) (for a flush-pkt)
Parameters | |
line | The line read from the wire. |
allowed | An iterable of command names that should be allowed. Command names not listed below as possible return values will be ignored. If None, any commands from the possible return values are allowed. |
Raises | |
UnexpectedCommandError | if the line cannot be parsed into one of the allowed return values. |