module documentation

Generic functions for talking the git smart server protocol.

Class BufferedPktLineWriter Writer that wraps its data in pkt-lines and has an independent buffer.
Class PktLineParser Packet line parser that hands completed packets off to a callback.
Class Protocol Class for interacting with a remote git process over the wire.
Class ReceivableProtocol Variant of Protocol that allows reading up to a size without blocking.
Function ack_type Extract the ack type from a capabilities list.
Function agent_string Undocumented
Function capability_agent Undocumented
Function capability_symref Undocumented
Function extract_capabilities Extract a capabilities list from a string, if present.
Function extract_capability_names Undocumented
Function extract_want_line_capabilities Extract a capabilities list from a want line, if present.
Function format_ack_line Undocumented
Function format_capability_line Undocumented
Function format_cmd_pkt Undocumented
Function format_ref_line Undocumented
Function format_shallow_line Undocumented
Function format_unshallow_line Undocumented
Function parse_capability Undocumented
Function parse_cmd_pkt Undocumented
Function pkt_line Wrap data in a pkt-line.
Function symref_capabilities Undocumented
Constant CAPABILITIES_REF Undocumented
Constant CAPABILITY_AGENT Undocumented
Constant CAPABILITY_ALLOW_REACHABLE_SHA1_IN_WANT Undocumented
Constant CAPABILITY_ALLOW_TIP_SHA1_IN_WANT Undocumented
Constant CAPABILITY_ATOMIC Undocumented
Constant CAPABILITY_DEEPEN_NOT Undocumented
Constant CAPABILITY_DEEPEN_RELATIVE Undocumented
Constant CAPABILITY_DEEPEN_SINCE Undocumented
Constant CAPABILITY_DELETE_REFS Undocumented
Constant CAPABILITY_INCLUDE_TAG Undocumented
Constant CAPABILITY_MULTI_ACK Undocumented
Constant CAPABILITY_MULTI_ACK_DETAILED Undocumented
Constant CAPABILITY_NO_DONE Undocumented
Constant CAPABILITY_NO_PROGRESS Undocumented
Constant CAPABILITY_OFS_DELTA Undocumented
Constant CAPABILITY_QUIET Undocumented
Constant CAPABILITY_REPORT_STATUS Undocumented
Constant CAPABILITY_SHALLOW Undocumented
Constant CAPABILITY_SIDE_BAND Undocumented
Constant CAPABILITY_SIDE_BAND_64K Undocumented
Constant CAPABILITY_SYMREF Undocumented
Constant CAPABILITY_THIN_PACK Undocumented
Constant COMMAND_DEEPEN Undocumented
Constant COMMAND_DONE Undocumented
Constant COMMAND_HAVE Undocumented
Constant COMMAND_SHALLOW Undocumented
Constant COMMAND_UNSHALLOW Undocumented
Constant COMMAND_WANT Undocumented
Constant COMMON_CAPABILITIES Undocumented
Constant DEPTH_INFINITE Undocumented
Constant KNOWN_RECEIVE_CAPABILITIES Undocumented
Constant KNOWN_UPLOAD_CAPABILITIES Undocumented
Constant MULTI_ACK Undocumented
Constant MULTI_ACK_DETAILED Undocumented
Constant NAK_LINE Undocumented
Constant SIDE_BAND_CHANNEL_DATA Undocumented
Constant SIDE_BAND_CHANNEL_FATAL Undocumented
Constant SIDE_BAND_CHANNEL_PROGRESS Undocumented
Constant SINGLE_ACK Undocumented
Constant TCP_GIT_PORT Undocumented
Constant ZERO_SHA Undocumented
Constant _RBUFSIZE Undocumented
def ack_type(capabilities):

Extract the ack type from a capabilities list.

def agent_string():

Undocumented

def capability_agent():

Undocumented

def capability_symref(from_ref, to_ref):

Undocumented

def extract_capabilities(text):

Extract a capabilities list from a string, if present.

Returns: Tuple with text with capabilities removed and list of capabilities

Parameters
textString to extract from
def extract_capability_names(capabilities):

Undocumented

def extract_want_line_capabilities(text):

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
textWant line to extract from
def format_ack_line(sha, ack_type=b''):

Undocumented

def format_capability_line(capabilities):

Undocumented

def format_cmd_pkt(cmd, *args):

Undocumented

def format_ref_line(ref, sha, capabilities=None):

Undocumented

def format_shallow_line(sha):

Undocumented

def format_unshallow_line(sha):

Undocumented

def parse_capability(capability):

Undocumented

def parse_cmd_pkt(line):

Undocumented

def pkt_line(data):

Wrap data in a pkt-line.

Returns: The data prefixed with its length in pkt-line format; if data was
None, returns the flush-pkt ('0000').
Parameters
dataThe data to wrap, as a str or None.
def symref_capabilities(symrefs):

Undocumented

CAPABILITIES_REF: bytes =

Undocumented

Value
b'capabilities^{}'
CAPABILITY_AGENT: bytes =

Undocumented

Value
b'agent'
CAPABILITY_ALLOW_REACHABLE_SHA1_IN_WANT: bytes =

Undocumented

Value
b'allow-reachable-sha1-in-want'
CAPABILITY_ALLOW_TIP_SHA1_IN_WANT: bytes =

Undocumented

Value
b'allow-tip-sha1-in-want'
CAPABILITY_ATOMIC: bytes =

Undocumented

Value
b'atomic'
CAPABILITY_DEEPEN_NOT: bytes =

Undocumented

Value
b'deepen-not'
CAPABILITY_DEEPEN_RELATIVE: bytes =

Undocumented

Value
b'deepen-relative'
CAPABILITY_DEEPEN_SINCE: bytes =

Undocumented

Value
b'deepen-since'
CAPABILITY_DELETE_REFS: bytes =

Undocumented

Value
b'delete-refs'
CAPABILITY_INCLUDE_TAG: bytes =

Undocumented

Value
b'include-tag'
CAPABILITY_MULTI_ACK: bytes =

Undocumented

Value
b'multi_ack'
CAPABILITY_MULTI_ACK_DETAILED: bytes =

Undocumented

Value
b'multi_ack_detailed'
CAPABILITY_NO_DONE: bytes =

Undocumented

Value
b'no-done'
CAPABILITY_NO_PROGRESS: bytes =

Undocumented

Value
b'no-progress'
CAPABILITY_OFS_DELTA: bytes =

Undocumented

Value
b'ofs-delta'
CAPABILITY_QUIET: bytes =

Undocumented

Value
b'quiet'
CAPABILITY_REPORT_STATUS: bytes =

Undocumented

Value
b'report-status'
CAPABILITY_SHALLOW: bytes =

Undocumented

Value
b'shallow'
CAPABILITY_SIDE_BAND: bytes =

Undocumented

Value
b'side-band'
CAPABILITY_SIDE_BAND_64K: bytes =

Undocumented

Value
b'side-band-64k'
CAPABILITY_SYMREF: bytes =

Undocumented

Value
b'symref'
CAPABILITY_THIN_PACK: bytes =

Undocumented

Value
b'thin-pack'
COMMAND_DEEPEN: bytes =

Undocumented

Value
b'deepen'
COMMAND_DONE: bytes =

Undocumented

Value
b'done'
COMMAND_HAVE: bytes =

Undocumented

Value
b'have'
COMMAND_SHALLOW: bytes =

Undocumented

Value
b'shallow'
COMMAND_UNSHALLOW: bytes =

Undocumented

Value
b'unshallow'
COMMAND_WANT: bytes =

Undocumented

Value
b'want'
DEPTH_INFINITE: int =

Undocumented

Value
2147483647
MULTI_ACK: int =

Undocumented

Value
1
MULTI_ACK_DETAILED: int =

Undocumented

Value
2
NAK_LINE: bytes =

Undocumented

Value
b'''NAK
'''
SIDE_BAND_CHANNEL_DATA: int =

Undocumented

Value
1
SIDE_BAND_CHANNEL_FATAL: int =

Undocumented

Value
3
SIDE_BAND_CHANNEL_PROGRESS: int =

Undocumented

Value
2
SINGLE_ACK: int =

Undocumented

Value
0
TCP_GIT_PORT: int =

Undocumented

Value
9418
ZERO_SHA =

Undocumented

Value
b'0'*40
_RBUFSIZE: int =

Undocumented

Value
8192