stash#

For git-stash(1).

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

Bases: object

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)
''
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 stash.

Examples

>>> GitStashCmd(dir=git_local_clone.dir).run()
'No local changes to save'
Return type:

str

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

git stash list

Examples

>>> GitStashCmd(dir=git_local_clone.dir)._list()
''
Return type:

str

Parameters:
push(*, path=None, patch=None, staged=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#

git stash update

TODO: Fill-in

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'
Return type:

str

Parameters:
pop(*, stash=None, index=None, quiet=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]#

git stash pop

Examples

>>> GitStashCmd(dir=git_local_clone.dir).pop()
'No stash entries found.'
>>> GitStashCmd(dir=git_local_clone.dir).pop(stash=0)
'error: refs/[email protected]{0} is not a valid reference'
>>> GitStashCmd(dir=git_local_clone.dir).pop(stash=1, index=True)
'error: refs/[email protected]{1} is not a valid reference'
>>> GitStashCmd(dir=git_local_clone.dir).pop(stash=1, quiet=True)
'error: refs/[email protected]{1} is not a valid reference'
>>> GitStashCmd(dir=git_local_clone.dir).push(path='.')
'No local changes to save'
Return type:

str

Parameters:
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

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'
Return type:

str

Parameters: