class documentation

A Git Client that works over TCP directly (i.e. git://).

Class Method from_parsedurl Create an instance of TCPGitClient from a parsed URL.
Method __init__ Initialize a TCPGitClient.
Method get_url Get the URL for a TCP git connection.
Instance Variable protocol_version Undocumented
Method _connect Create a connection to the server.
Method _connect_via_proxy Connect to a git server via a proxy command.
Instance Variable _host Undocumented
Instance Variable _port Undocumented
Instance Variable _proxy_command Undocumented

Inherited from TraditionalGitClient:

Method archive Request an archive of a specific commit.
Method fetch_pack Retrieve a pack from a git smart server.
Method get_refs Retrieve the current refs from a git smart server.
Method send_pack Upload a pack to a remote repository.
Constant DEFAULT_ENCODING Undocumented
Instance Variable _remote_path_encoding Undocumented
Instance Variable _report_status_parser Undocumented

Inherited from GitClient (via TraditionalGitClient):

Method clone Clone a repository.
Method close Close the client and release any resources.
Method fetch Fetch into a target repository.
Method fetch_with_bundle_uri Fetch into a target repository, using bundle URIs for bootstrap.
Static Method _should_send_pack Undocumented
Static Method _warn_filter_objects Undocumented
Method _handle_receive_pack_tail Handle the tail of a 'git-receive-pack' request.
Method _negotiate_receive_pack_capabilities Undocumented
Method _negotiate_upload_pack_capabilities Undocumented
Instance Variable _fetch_capabilities Undocumented
Instance Variable _report_activity Undocumented
Instance Variable _send_capabilities Undocumented
def from_parsedurl(cls, parsedurl: ParseResult, thin_packs: bool = True, report_activity: Callable[[int, str], None] | None = None, quiet: bool = False, include_tags: bool = False, dumb: bool = False, username: str | None = None, password: str | None = None, config: Config | None = None) -> TCPGitClient:

Create an instance of TCPGitClient from a parsed URL.

Parameters
parsedurl:ParseResultResult of urlparse()
thin_packs:boolWhether or not thin packs should be retrieved
report_activity:Callable[[int, str], None] | NoneOptional callback for reporting transport activity
quiet:boolWhether to suppress progress output
include_tags:boolWhether to include tags
dumb:boolWhether to use dumb protocol (not used for TCPGitClient)
username:str | NoneUsername for authentication (not used for TCPGitClient)
password:str | NonePassword for authentication (not used for TCPGitClient)
config:Config | NoneConfiguration object
Returns
TCPGitClientA TCPGitClient instance
def __init__(self, host: str, port: int | None = None, thin_packs: bool = True, report_activity: Callable[[int, str], None] | None = None, quiet: bool = False, include_tags: bool = False, proxy_command: str | None = None):

Initialize a TCPGitClient.

Parameters
host:strHostname or IP address to connect to
port:int | NonePort number (defaults to TCP_GIT_PORT)
thin_packs:boolWhether or not thin packs should be retrieved
report_activity:Callable[[int, str], None] | NoneOptional callback for reporting transport activity
quiet:boolWhether to suppress progress output
include_tags:boolWhether to include tags
proxy_command:str | NoneOptional proxy command (core.gitProxy). The command is run with host and port as arguments and communicates over stdin/stdout.
def get_url(self, path: str) -> str:

Get the URL for a TCP git connection.

Parameters
path:strRepository path
Returns
strgit:// URL for the path
protocol_version =
def _connect(self, cmd: bytes, path: str | bytes, protocol_version: int | None = None) -> tuple[Protocol, Callable[[], bool], IO[bytes] | None]:

Create a connection to the server.

This method is abstract - concrete implementations should implement their own variant which connects to the server and returns an initialized Protocol object with the service ready for use and a can_read function which may be used to see if reads would block.

Parameters
cmd:bytesThe git service name to which we should connect.
path:str | bytesThe path we should pass to the service. (as bytestirng)
protocol_version:int | NoneDesired Git protocol version. By default the highest mutually supported protocol version will be used.
Returns
tuple[Protocol, Callable[[], bool], IO[bytes] | None]Undocumented
def _connect_via_proxy(self, cmd: bytes, path: bytes, protocol_version: int | None = None) -> tuple[Protocol, Callable[[], bool], IO[bytes] | None]:

Connect to a git server via a proxy command.

The proxy command is invoked with the host and port as arguments. It communicates with the git server over its stdin/stdout, acting as a transparent tunnel.

_host =

Undocumented

_port =

Undocumented

_proxy_command =

Undocumented