submodule#

For git-submodule(1).

class libvcs.cmd.git.GitSubmoduleCmd(*, dir, cmd=None)[source]#

Bases: object

Lite, typed, pythonic wrapper for git-submodule(1).

Parameters:

Examples

>>> GitSubmoduleCmd(dir=tmp_path)
<GitSubmoduleCmd dir=...>
>>> GitSubmoduleCmd(dir=tmp_path).run(quiet=True)
'fatal: not a git repository (or any of the parent directories): .git'
>>> GitSubmoduleCmd(dir=git_local_clone.dir).run(quiet=True)
''
__init__(*, dir, cmd=None)[source]#

Lite, typed, pythonic wrapper for git-submodule(1).

Parameters:
Return type:

None

Examples

>>> GitSubmoduleCmd(dir=tmp_path)
<GitSubmoduleCmd dir=...>
>>> GitSubmoduleCmd(dir=tmp_path).run(quiet=True)
'fatal: not a git repository (or any of the parent directories): .git'
>>> GitSubmoduleCmd(dir=git_local_clone.dir).run(quiet=True)
''
dir: Path#

Directory to check out

run(command=None, local_flags=None, *, quiet=None, cached=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#

Wraps git submodule.

Examples

>>> GitSubmoduleCmd(dir=git_local_clone.dir).run()
''
Return type:

str

Parameters:
init(*, path=None, log_in_real_time=False, check_returncode=None)[source]#

git submodule init

Examples

>>> GitSubmoduleCmd(dir=git_local_clone.dir).init()
''
Return type:

str

Parameters:
update(*, path=None, init=None, force=None, checkout=None, rebase=None, merge=None, recursive=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#

git submodule update

Examples

>>> GitSubmoduleCmd(dir=git_local_clone.dir).update()
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(init=True)
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(init=True, recursive=True)
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(
...     init=True, filter="blob:none"
... )
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(force=True)
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(checkout=True)
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(rebase=True)
''
>>> GitSubmoduleCmd(dir=git_local_clone.dir).update(merge=True)
''
Return type:

str

Parameters: