submodule
#
For git-submodule(1)
.
- class libvcs.cmd.git.GitSubmoduleCmd(*, dir, cmd=None)[source]#
Bases:
object
Run submodule commands in a git repository.
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) ''
- run(command=None, local_flags=None, *, quiet=None, cached=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#
Run a command against a git submodule.
Wraps git submodule.
- Return type:
- Parameters:
Examples
>>> GitSubmoduleCmd(dir=git_local_clone.dir).run() ''
- init(*, path=None, log_in_real_time=False, check_returncode=None)[source]#
Git submodule init.
- Return type:
- Parameters:
Examples
>>> GitSubmoduleCmd(dir=git_local_clone.dir).init() ''
- 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.
- Return type:
- Parameters:
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(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) ''