[PATCH] Disable implicit 'save' argument for 'git stash'
From: Brian Downing <hidden>
Date: 2016-06-15 22:43:48
Subsystem:
the rest · Maintainer:
Linus Torvalds
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 <redacted>
---
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