stash
¶
For git-stash(1)
.
- class libvcs.cmd.git.GitStashCmd(*, path, 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(path=tmp_path) <GitStashCmd path=...>
>>> GitStashCmd(path=tmp_path).run(quiet=True) 'fatal: not a git repository (or any of the parent directories): .git'
>>> GitStashCmd(path=example_git_repo.path).run(quiet=True) ''
- __init__(*, path, cmd=None)[source]¶
Lite, typed, pythonic wrapper for git-stash(1).
- Parameters:
- Return type:
None
Examples
>>> GitStashCmd(path=tmp_path) <GitStashCmd path=...>
>>> GitStashCmd(path=tmp_path).run(quiet=True) 'fatal: not a git repository (or any of the parent directories): .git'
>>> GitStashCmd(path=example_git_repo.path).run(quiet=True) ''
-
path:
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]¶
Run a command against a git repository’s stash storage.
Wraps git stash.
- Return type:
- Parameters:
Examples
>>> GitStashCmd(path=example_git_repo.path).run() 'No local changes to save'
- ls(*, log_in_real_time=False, check_returncode=None)[source]¶
Git stash list.
Examples
>>> GitStashCmd(path=example_git_repo.path).ls() ''
- 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(path=example_git_repo.path).push() 'No local changes to save'
>>> GitStashCmd(path=example_git_repo.path).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(path=example_git_repo.path).pop() 'No stash entries found.'
>>> GitStashCmd(path=example_git_repo.path).pop(stash=0) 'error: refs/stash@{0} is not a valid reference'
>>> GitStashCmd(path=example_git_repo.path).pop(stash=1, index=True) 'error: refs/stash@{1} is not a valid reference'
>>> GitStashCmd(path=example_git_repo.path).pop(stash=1, quiet=True) 'error: refs/stash@{1} is not a valid reference'
>>> GitStashCmd(path=example_git_repo.path).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(path=example_git_repo.path).save() 'No local changes to save'
>>> GitStashCmd(path=example_git_repo.path).save(message="Message") 'No local changes to save'