[PATCH] Disable implicit 'save' argument for 'git stash'

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Brian Downing
Date: Tuesday, November 6, 2007 - 5:26 pm

Having 'git stash random stuff' actually stash changes is poor
user interface, due to the likelyhood of misspelling another legitimate
argument.  Require an explicit 'save' command instead.

Signed-off-by: Brian Downing <bdowning@lavos.net>
---
    This commit can be applied on top of the previous whenever it
    is decided "enough time" has passed for the hard behavior change
    of "git stash" to take place.

 git-stash.sh     |   16 +++++-----------
 t/t3903-stash.sh |    4 ++--
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index a8b854a..e900d40 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -219,17 +219,11 @@ create)
 help | usage)
 	usage
 	;;
-*)
-	if test $# -gt 0 && test "$1" = save
-	then
-		shift
-	else
-		cat >&2 <<EOF
-'git stash [message...]' is deprecated, please use
-'git stash save [message...]' instead.
-
-EOF
-	fi
+save)
+	shift
 	save_stash "$*" && git-reset --hard
 	;;
+*)
+	usage
+	;;
 esac
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index adfac4b..4896da0 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -73,13 +73,13 @@ test_expect_success 'unstashing in a subdirectory' '
 	git stash apply
 '
 
-test_expect_success 'stash with no args' '
+test_expect_failure 'stash with no args' '
 	echo 7 > file &&
 	test_tick &&
 	git stash
 '
 
-test_expect_success 'stash with bare message' '
+test_expect_failure 'stash with bare message' '
 	echo 8 > file &&
 	test_tick &&
 	git stash "a message"
-- 
1.5.3.5.1547.gf6d81-dirty
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git pull opinion, Aghiles, (Mon Nov 5, 2:52 pm)
Re: git pull opinion, Alex Riesen, (Mon Nov 5, 3:49 pm)
Re: git pull opinion, Junio C Hamano, (Mon Nov 5, 4:33 pm)
Re: git pull opinion, Miklos Vajna, (Mon Nov 5, 4:40 pm)
Re: git pull opinion, Bill Lear, (Mon Nov 5, 5:36 pm)
Re: git pull opinion, Steven Grimm, (Mon Nov 5, 5:37 pm)
Re: git pull opinion, Pierre Habouzit, (Mon Nov 5, 5:46 pm)
Re: git pull opinion, Andreas Ericsson, (Mon Nov 5, 5:54 pm)
Re: git pull opinion, Johannes Schindelin, (Mon Nov 5, 6:16 pm)
Re: git pull opinion, Aghiles, (Mon Nov 5, 9:04 pm)
Re: git pull opinion, Aghiles, (Mon Nov 5, 9:16 pm)
Re: git pull opinion, Benoit Sigoure, (Mon Nov 5, 10:29 pm)
Re: git pull opinion, Aghiles, (Mon Nov 5, 11:30 pm)
Re: git pull opinion, Ralf Wildenhues, (Tue Nov 6, 12:34 am)
Re: git pull opinion, Alex Riesen, (Tue Nov 6, 12:38 am)
Re: git pull opinion, Alex Riesen, (Tue Nov 6, 12:40 am)
Re: git pull opinion, Aghiles, (Tue Nov 6, 12:45 am)
Re: git pull opinion, Pierre Habouzit, (Tue Nov 6, 1:31 am)
Re: git pull opinion, Pierre Habouzit, (Tue Nov 6, 1:51 am)
Re: git pull opinion, Andreas Ericsson, (Tue Nov 6, 1:59 am)
Re: git pull opinion, Johannes Schindelin, (Tue Nov 6, 4:59 am)
Re: git pull opinion, Johannes Schindelin, (Tue Nov 6, 5:05 am)
Re: git pull opinion, Andreas Ericsson, (Tue Nov 6, 5:08 am)
Re: git pull opinion, Linus Torvalds, (Tue Nov 6, 9:36 am)
Re: git pull opinion, Pascal Obry, (Tue Nov 6, 11:07 am)
Re: git pull opinion, Ralf Wildenhues, (Tue Nov 6, 1:22 pm)
[PATCH] Mark 'git stash [message...]' as deprecated, Brian Downing, (Tue Nov 6, 5:26 pm)
[PATCH] Disable implicit 'save' argument for 'git stash', Brian Downing, (Tue Nov 6, 5:26 pm)
Re: git pull opinion, Uwe , (Wed Nov 7, 12:06 am)
Re: git pull opinion, Pascal Obry, (Wed Nov 7, 12:40 am)
Re: [PATCH] Mark 'git stash [message...]' as deprecated, Johannes Sixt, (Wed Nov 7, 1:00 am)
Re: [PATCH] Mark 'git stash [message...]' as deprecated, Junio C Hamano, (Wed Nov 7, 1:02 am)
Re: [PATCH] Mark 'git stash [message...]' as deprecated, Wincent Colaiuta, (Wed Nov 7, 1:12 am)
Re: [PATCH] Mark 'git stash [message...]' as deprecated, Pierre Habouzit, (Wed Nov 7, 1:23 am)
Re: git pull opinion, Aghiles, (Wed Nov 7, 2:25 pm)
Re: git pull opinion, Johannes Schindelin, (Thu Nov 8, 8:27 am)
Re: git pull opinion, Linus Torvalds, (Fri Nov 9, 5:36 pm)