Thread (1 message) 1 message, 1 author, 2017-02-17

Re: [PATCH v5 0/6] stash: support pathspec argument

From: Thomas Gummerer <hidden>
Date: 2017-02-17 23:05:43

On 02/17, Junio C Hamano wrote:
Thomas Gummerer [off-list ref] writes:
quoted
Thanks Matthieu, Peff and Junio for the discussion on v3 and v4.

Changes since v4:
Dropped patch 1 from the series, as it's already in master

Instead of changing the external interface to git stash create, only
refactor the internal create_stash() function to take -m and -u
arguments.  This also simplifies the internal option parsing.
Yay.
quoted
Make git stash -p an alias for git stash push -p, so git stash -p
<pathspec> is allowed.
Nice.
quoted
Interdiff below:
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index b0825f4aca..97194576ef 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -53,9 +53,8 @@ OPTIONS
 save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]::
 push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--] [<pathspec>...]::
 
-	Save your local modifications to a new 'stash' and roll them
-	back to HEAD (in the working tree and in the index).
-	The <message> part is optional and gives
+	Save your local modifications to a new 'stash', and run `git reset
+	--hard` to revert them.  The <message> part is optional and gives
 	the description along with the stashed state.  For quickly making
 	a snapshot, you can omit _both_ "save" and <message>, but giving
 	only <message> does not trigger this action to prevent a misspelled
diff --git a/git-stash.sh b/git-stash.sh
index a184b1e274..1446fbe2e8 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -67,51 +67,20 @@ create_stash () {
 		case "$1" in
 		-m|--message)
 			shift
-			test -z ${1+x} && usage
-			stash_msg="$1"
-			new_style=t
+			stash_msg=${1-"BUG: create_stash () -m requires an argument"}
Hmph, did you mean ${1?"BUG: ..."}?  The same for the one in "-u".
Ah yes sorry, you're right course.  Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help