Generic functions for talking the git smart server protocol.
| Class | |
Writer that wraps its data in pkt-lines and has an independent buffer. |
| Class | |
Packet line parser that hands completed packets off to a callback. |
| Class | |
Class for interacting with a remote git process over the wire. |
| Class | |
Variant of Protocol that allows reading up to a size without blocking. |
| Function | ack |
Extract the ack type from a capabilities list. |
| Function | agent |
Generate the agent string for dulwich. |
| Function | capability |
Generate the agent capability string. |
| Function | capability |
Generate the object-format capability string. |
| Function | capability |
Generate a symref capability string. |
| Function | extract |
Extract a capabilities list from a string, if present. |
| Function | extract |
Extract capability names from a list of capabilities. |
| Function | extract |
Extract a capabilities list from a want line, if present. |
| Function | find |
Find a capability value in a list of capabilities. |
| Function | format |
Format an ACK line. |
| Function | format |
Format a capabilities list for the wire protocol. |
| Function | format |
Format a command packet. |
| Function | format |
Format a ref advertisement line. |
| Function | format |
Format a shallow line. |
| Function | format |
Format an unshallow line. |
| Function | parse |
Parse a capability string into name and value. |
| Function | parse |
Parse a command packet. |
| Function | pkt |
Wrap data in a pkt-line. |
| Function | pkt |
Wrap a sequence of data in pkt-lines. |
| Function | serialize |
Serialize refs with peeled refs for Git protocol v0/v1. |
| Function | split |
Split peeled refs from regular refs. |
| Function | strip |
Remove all peeled refs from a refs dictionary. |
| Function | symref |
Generate symref capability strings from symref pairs. |
| Function | write |
Generate info refs in the format used by the dumb HTTP protocol. |
| Constant | CAPABILITIES |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | CAPABILITY |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMAND |
Undocumented |
| Constant | COMMON |
Undocumented |
| Constant | DEFAULT |
Undocumented |
| Constant | DEFAULT |
Undocumented |
| Constant | DEPTH |
Undocumented |
| Constant | GIT |
Undocumented |
| Constant | KNOWN |
Undocumented |
| Constant | KNOWN |
Undocumented |
| Constant | MULTI |
Undocumented |
| Constant | MULTI |
Undocumented |
| Constant | NAK |
Undocumented |
| Constant | PEELED |
Undocumented |
| Constant | SIDE |
Undocumented |
| Constant | SIDE |
Undocumented |
| Constant | SIDE |
Undocumented |
| Constant | SINGLE |
Undocumented |
| Constant | TCP |
Undocumented |
| Constant | ZERO |
Undocumented |
| Variable | logger |
Undocumented |
| Constant | _RBUFSIZE |
Undocumented |
Extract a capabilities list from a want line, if present.
Note that want lines have capabilities separated from the rest of the line by a space instead of a null byte. Thus want lines have the form:
want obj-id cap1 cap2 ...
Returns: Tuple with text with capabilities removed and list of capabilities
| Parameters | |
text:bytes | Want line to extract from |
| Returns | |
tuple[ | Undocumented |
Find a capability value in a list of capabilities.
This function looks for capabilities that may include arguments after an equals sign and returns only the value part (after the '='). For capabilities without values, returns the capability name itself.
Example
>>> caps = [b'filter=blob:none', b'agent=git/2.0', b'thin-pack'] >>> find_capability(caps, b'filter') b'blob:none' >>> find_capability(caps, b'thin-pack') b'thin-pack' >>> find_capability(caps, b'missing') None
| Parameters | |
capabilities:Iterable[ | List of capability strings |
*capabilitybytes | Capability name(s) to search for |
| Returns | |
bytes | None | The value after '=' if found, or the capability name if no '=', or None if not found |
ObjectContainer, refs: Mapping[ Ref, ObjectID]) -> dict[ bytes, ObjectID]:
¶
Serialize refs with peeled refs for Git protocol v0/v1.
This function is used to prepare refs for transmission over the Git protocol. For tags, it includes both the tag object and the dereferenced object.
| Parameters | |
store:ObjectContainer | Object store to peel refs from |
refs:Mapping[ | Dictionary of ref names to SHAs |
| Returns | |
dict[ | Dictionary with refs and peeled refs (marked with ^{}) |
Undocumented
| Value |
|
Undocumented
| Value |
|