stash
#
For git-stash(1)
.
- class libvcs.cmd.git.GitStashCmd(*, dir, cmd=None)[source]#
Bases:
object
Run commands directly against a git stash storage for a git repo.
Lite, typed, pythonic wrapper for git-stash(1).
- Parameters:
Examples
>>> GitStashCmd(dir=tmp_path) <GitStashCmd dir=...>
>>> GitStashCmd(dir=tmp_path).run(quiet=True) 'fatal: not a git repository (or any of the parent directories): .git'
>>> GitStashCmd(dir=git_local_clone.dir).run(quiet=True) ''
- __init__(*, dir, cmd=None)[source]#
Lite, typed, pythonic wrapper for git-stash(1).
- Parameters:
- Return type:
None
Examples
>>> GitStashCmd(dir=tmp_path) <GitStashCmd dir=...>
>>> GitStashCmd(dir=tmp_path).run(quiet=True) 'fatal: not a git repository (or any of the parent directories): .git'
>>> GitStashCmd(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 repositoryβs stash storage.
Wraps git stash.
- Return type:
- Parameters:
Examples
>>> GitStashCmd(dir=git_local_clone.dir).run() 'No local changes to save'
- _list(*, log_in_real_time=False, check_returncode=None)[source]#
Git stash list.
Examples
>>> GitStashCmd(dir=git_local_clone.dir)._list() ''
- push(*, path=None, patch=None, staged=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#
Git stash update.
TODO: Fill-in
- Return type:
- Parameters:
Examples
>>> GitStashCmd(dir=git_local_clone.dir).push() 'No local changes to save'
>>> GitStashCmd(dir=git_local_clone.dir).push(path='.') 'No local changes to save'
- pop(*, stash=None, index=None, quiet=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#
Git stash pop.
- Return type:
- Parameters:
Examples
>>> GitStashCmd(dir=git_local_clone.dir).pop() 'No stash entries found.'
>>> GitStashCmd(dir=git_local_clone.dir).pop(stash=0) 'error: refs/stash@{0} is not a valid reference'
>>> GitStashCmd(dir=git_local_clone.dir).pop(stash=1, index=True) 'error: refs/stash@{1} is not a valid reference'
>>> GitStashCmd(dir=git_local_clone.dir).pop(stash=1, quiet=True) 'error: refs/stash@{1} is not a valid reference'
>>> GitStashCmd(dir=git_local_clone.dir).push(path='.') 'No local changes to save'
- save(*, message=None, staged=None, keep_index=None, patch=None, include_untracked=None, all=None, quiet=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#
Git stash save.
- Return type:
- Parameters:
Examples
>>> GitStashCmd(dir=git_local_clone.dir).save() 'No local changes to save'
>>> GitStashCmd(dir=git_local_clone.dir).save(message="Message") 'No local changes to save'