libvcs.sync.git

For git(1).

Compare to: fabtools.require.git, salt.states.git, ansible.builtin.git

Tool to manage a local git clone from an external git repository.

exception libvcs.sync.git.GitStatusParsingException
exception[source]

Bases: LibVCSException

Raised when git status output is not in the expected format.

exception libvcs.sync.git.GitRemoteOriginMissing
exception[source]

Bases: LibVCSException

Raised when git origin remote was not found.

exception libvcs.sync.git.GitRemoteSetError
exception[source]

Bases: LibVCSException

Raised when a git remote could not be set.

exception libvcs.sync.git.GitNoBranchFound
exception[source]

Bases: LibVCSException

Raised with git branch could not be found.

exception libvcs.sync.git.GitRemoteRefNotFound
exception[source]

Bases: CommandError

Raised when a git remote ref (tag, branch) could not be found.

class libvcs.sync.git.GitRemote

Bases: object

Structure containing git working copy information.

class libvcs.sync.git.GitStatus

Bases: object

Git status information.

libvcs.sync.git.convert_pip_url(pip_url)
function[source]

Convert pip-style URL to a VCSLocation.

Prefixes stub URLs like ‘user@hostname:user/repo.git’ with ‘ssh://’. That’s required because although they use SSH they sometimes doesn’t work with a ssh:// scheme (e.g. Github). But we need a scheme for parsing. Hence we remove it again afterwards and return it as a stub. The manpage for git-clone(1) refers to this as the “scp-like styntax”.

Parameters:

pip_url (str)

Return type:

VCSLocation

class libvcs.sync.git.GitSync

Bases: BaseSync

Tool to manage a local git clone from an external git repository.