summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e25d5f9)
raw | patch | inline | side by side (parent: e25d5f9)
author | Brandon Casey <casey@nrlssc.navy.mil> | |
Fri, 22 Feb 2008 22:52:50 +0000 (16:52 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Feb 2008 06:59:11 +0000 (22:59 -0800) |
This combines the existing stash subcommands 'apply' and 'drop' to
allow a single stash entry to be applied and then dropped, in other
words 'popped', from the stash list.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
allow a single stash entry to be applied and then dropped, in other
words 'popped', from the stash list.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-stash.txt | patch | blob | history | |
git-stash.sh | patch | blob | history |
index f50c24ce9aa1c1d2937f3eb8ee27b349a6f0a3ba..8dc35d493e81bc0c5515ec279dbe95c464c57469 100644 (file)
SYNOPSIS
--------
[verse]
-'git-stash' (list | show [<stash>] | apply [<stash>] | clear | drop [<stash>])
+'git-stash' (list | show [<stash>] | apply [<stash>] | clear | drop [<stash>] | pop [<stash>])
'git-stash' [save [<message>]]
DESCRIPTION
Remove a single stashed state from the stash list. When no `<stash>`
is given, it removes the latest one. i.e. `stash@\{0}`
+pop [<stash>]::
+
+ Remove a single stashed state from the stash list and apply on top
+ of the current working tree state. When no `<stash>` is given,
+ `stash@\{0}` is assumed. See also `apply`.
+
DISCUSSION
----------
diff --git a/git-stash.sh b/git-stash.sh
index 5e3eb56791463e8aa10a6b8683411a5c231f1274..c2b68205a2b69eb91b2403e11238093fc65c04ef 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
-USAGE='[ | save | list | show | apply | clear | drop | create ]'
+USAGE='[ | save | list | show | apply | clear | drop | pop | create ]'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
shift
drop_stash "$@"
;;
+pop)
+ shift
+ if apply_stash "$@"
+ then
+ test -z "$unstash_index" || shift
+ drop_stash "$@"
+ fi
+ ;;
*)
if test $# -eq 0
then