dulwich.server
module documentationdulwich
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:
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 | Backend | A backend for the Git smart server implementation. |
Class | BackendRepo | Repository abstraction used by the Git server. |
Class | DictBackend | Trivial backend that looks up Git repositories in a dictionary. |
Class | FileSystemBackend | Simple backend looking up Git repositories in the local file system. |
Class | Handler | Smart protocol command handler base class. |
Class | PackHandler | Protocol handler for packs. |
Class | UploadPackHandler | Protocol handler for uploading a pack to the client. |
Class | SingleAckGraphWalkerImpl | Graph walker implementation that speaks the single-ack protocol. |
Class | MultiAckGraphWalkerImpl | Graph walker implementation that speaks the multi-ack protocol. |
Class | MultiAckDetailedGraphWalkerImpl | Graph walker implementation speaking the multi-ack-detailed protocol. |
Class | ReceivePackHandler | Protocol handler for downloading a pack from the client. |
Class | UploadArchiveHandler | Undocumented |
Class | TCPGitRequestHandler | Undocumented |
Class | TCPGitServer | Undocumented |
Function | main | Entry point for starting a TCP git server. |
Function | serve_command | Serve a single command. |
Function | generate_info_refs | Generate an info refs file. |
Function | generate_objects_info_packs | Generate an index for for packs. |
Function | update_server_info | Generate server info for dumb file access. |
Function | _split_proto_line | Split a line read from the wire. |
Function | _find_shallow | Find shallow commits according to a given depth. |
Function | _want_satisfied | Undocumented |
Function | _all_wants_satisfied | Check whether all the current wants are satisfied by a set of haves. |
Class | _ProtocolGraphWalker | A graph walker that knows the git protocol. |
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. | |
Returns | a tuple having one of the following forms: ('want', obj_id) ('have', obj_id) ('done', None) (None, None) (for a flush-pkt) | |
Raises | UnexpectedCommandError | if the line cannot be parsed into one of the allowed return values. |
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. | |
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 | Object store to retrieve objects from |
haves | A set of commits we know the client has. | |
wants | A set of commits the client wants | |
Note | Wants are specified with set_wants rather than passed in since in the current interface they are determined outside this class. |
Serve a single command.
This is mostly useful for the implementation of commands used by e.g. git+ssh.
Parameters | handler_cls | 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. | |
Returns | Exit code for use with sys.exit. 0 on success, 1 on failure. |