summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2017-10-22 17:04:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-27 00:59:11 (GMT)
commitc0c0c825ce19963ded30919778a23c3c85662755 (patch)
tree84e2659be31dc43c06e3512c9816ad403ad9c34d /git-stash.sh
parentfd2ebf14db52cc41e1cd39b1532d03cb1a702d47 (diff)
downloadgit-c0c0c825ce19963ded30919778a23c3c85662755.zip
git-c0c0c825ce19963ded30919778a23c3c85662755.tar.gz
git-c0c0c825ce19963ded30919778a23c3c85662755.tar.bz2
stash: remove now superfluos help for "stash push"
With the 'git stash save' interface, it was easily possible for users to try to add a message which would start with "-", which 'git stash save' would interpret as a command line argument, and fail. For this case we added some extra help on how to create a stash with a message starting with "-". For 'stash push', messages are passed with the -m flag, avoiding this potential pitfall. Now only pathspecs starting with "-" would have to be distinguished from command line parameters by using "-- --<pathspec>". This is fairly common in the git command line interface, and we don't try to guess what the users wanted in the other cases. Because this way of passing pathspecs is quite common in other git commands, and we don't provide any extra help there, do the same in the error message for 'git stash push'. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh13
1 files changed, 1 insertions, 12 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 3a4e5d1..4b74951 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -260,18 +260,7 @@ push_stash () {
;;
-*)
option="$1"
- # TRANSLATORS: $option is an invalid option, like
- # `--blah-blah'. The 7 spaces at the beginning of the
- # second line correspond to "error: ". So you should line
- # up the second line with however many characters the
- # translation of "error: " takes in your language. E.g. in
- # English this is:
- #
- # $ git stash push --blah-blah 2>&1 | head -n 2
- # error: unknown option for 'stash push': --blah-blah
- # To provide a message, use git stash push -m '--blah-blah'
- eval_gettextln "error: unknown option for 'stash push': \$option
- To provide a message, use git stash push -m '\$option'"
+ eval_gettextln "error: unknown option for 'stash push': \$option"
usage
;;
*)