From: Brian Downing <bdowning@lavos.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: tsuna@lrde.epita.fr, aghilesk@gmail.com, git@vger.kernel.org,
Brian Downing <bdowning@lavos.net>
Subject: [PATCH] Mark 'git stash [message...]' as deprecated
Date: Tue, 6 Nov 2007 18:26:44 -0600 [thread overview]
Message-ID: <1194395205-27905-1-git-send-email-bdowning@lavos.net> (raw)
In-Reply-To: <20071106085134.GD4435@artemis.corp>
Complain to STDERR unless 'git stash save' is explicitly used.
This is in preparation for completely disabling the "default save"
behavior of the command in the future.
Signed-off-by: Brian Downing <bdowning@lavos.net>
---
Documentation/git-stash.txt | 9 ++++-----
git-stash.sh | 8 +++++++-
t/t3903-stash.sh | 14 +++++++++++++-
3 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index c0147b9..61cf95d 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git-stash' (list | show [<stash>] | apply [<stash>] | clear)
-'git-stash' [save] [message...]
+'git-stash' save [message...]
DESCRIPTION
-----------
@@ -39,8 +39,7 @@ OPTIONS
save::
Save your local modifications to a new 'stash', and run `git-reset
- --hard` to revert them. This is the default action when no
- subcommand is given.
+ --hard` to revert them.
list::
@@ -119,7 +118,7 @@ perform a pull, and then unstash, like this:
$ git pull
...
file foobar not up to date, cannot merge.
-$ git stash
+$ git stash save
$ git pull
$ git stash apply
----------------------------------------------------------------
@@ -147,7 +146,7 @@ You can use `git-stash` to simplify the above, like this:
+
----------------------------------------------------------------
... hack hack hack ...
-$ git stash
+$ git stash save
$ edit emergency fix
$ git commit -a -m "Fix in a hurry"
$ git stash apply
diff --git a/git-stash.sh b/git-stash.sh
index f39bd55..a8b854a 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
-USAGE='[ | list | show | apply | clear]'
+USAGE='[save | list | show | apply | clear]'
SUBDIRECTORY_OK=Yes
. git-sh-setup
@@ -223,6 +223,12 @@ help | 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_stash "$*" && git-reset --hard
;;
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9a9a250..adfac4b 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -16,7 +16,7 @@ test_expect_success 'stash some dirty working directory' '
git add file &&
echo 3 > file &&
test_tick &&
- git stash &&
+ git stash save &&
git diff-files --quiet &&
git diff-index --cached --quiet HEAD
'
@@ -73,4 +73,16 @@ test_expect_success 'unstashing in a subdirectory' '
git stash apply
'
+test_expect_success 'stash with no args' '
+ echo 7 > file &&
+ test_tick &&
+ git stash
+'
+
+test_expect_success 'stash with bare message' '
+ echo 8 > file &&
+ test_tick &&
+ git stash "a message"
+'
+
test_done
--
1.5.3.5.1547.gf6d81-dirty
next prev parent reply other threads:[~2007-11-07 1:35 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 21:52 git pull opinion Aghiles
2007-11-05 22:28 ` Jakub Narebski
2007-11-06 0:08 ` Johannes Schindelin
2007-11-06 4:22 ` Aghiles
2007-11-06 12:02 ` Johannes Schindelin
2007-11-06 18:13 ` Junio C Hamano
2007-11-06 18:28 ` Johannes Schindelin
2007-11-05 22:49 ` Alex Riesen
2007-11-05 23:33 ` Junio C Hamano
2007-11-06 0:36 ` Bill Lear
2007-11-06 0:46 ` Pierre Habouzit
2007-11-06 7:38 ` Alex Riesen
2007-11-06 8:31 ` Pierre Habouzit
2007-11-06 0:54 ` Andreas Ericsson
2007-11-06 1:16 ` Johannes Schindelin
2007-11-06 8:59 ` Andreas Ericsson
2007-11-06 12:05 ` Johannes Schindelin
2007-11-06 12:08 ` Andreas Ericsson
2007-11-06 6:30 ` Aghiles
2007-11-06 7:40 ` Alex Riesen
2007-11-06 16:36 ` Linus Torvalds
2007-11-07 21:25 ` Aghiles
2007-11-08 15:27 ` Johannes Schindelin
2007-11-10 0:36 ` Linus Torvalds
2007-11-06 0:37 ` Steven Grimm
2007-11-06 4:04 ` Aghiles
2007-11-05 23:40 ` Miklos Vajna
2007-11-06 4:16 ` Aghiles
2007-11-06 5:29 ` Benoit Sigoure
2007-11-06 7:34 ` Ralf Wildenhues
2007-11-06 11:59 ` Johannes Schindelin
2007-11-06 20:22 ` Ralf Wildenhues
2007-11-06 7:45 ` Aghiles
2007-11-06 8:51 ` Pierre Habouzit
2007-11-07 0:26 ` Brian Downing [this message]
2007-11-07 0:26 ` [PATCH] Disable implicit 'save' argument for 'git stash' Brian Downing
2007-11-07 8:00 ` [PATCH] Mark 'git stash [message...]' as deprecated Johannes Sixt
2007-11-07 8:12 ` Wincent Colaiuta
2007-11-07 8:02 ` Junio C Hamano
2007-11-07 8:23 ` Pierre Habouzit
2007-11-06 18:07 ` git pull opinion Pascal Obry
2007-11-07 7:06 ` Uwe Kleine-König
2007-11-07 7:40 ` Pascal Obry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1194395205-27905-1-git-send-email-bdowning@lavos.net \
--to=bdowning@lavos.net \
--cc=aghilesk@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tsuna@lrde.epita.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).