Skip to content

Commit c0c0c82

Browse files
tgummerergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd2ebf1 commit c0c0c82

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

git-stash.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,7 @@ push_stash () {
260260
;;
261261
-*)
262262
option="$1"
263-
# TRANSLATORS: $option is an invalid option, like
264-
# `--blah-blah'. The 7 spaces at the beginning of the
265-
# second line correspond to "error: ". So you should line
266-
# up the second line with however many characters the
267-
# translation of "error: " takes in your language. E.g. in
268-
# English this is:
269-
#
270-
# $ git stash push --blah-blah 2>&1 | head -n 2
271-
# error: unknown option for 'stash push': --blah-blah
272-
# To provide a message, use git stash push -m '--blah-blah'
273-
eval_gettextln "error: unknown option for 'stash push': \$option
274-
To provide a message, use git stash push -m '\$option'"
263+
eval_gettextln "error: unknown option for 'stash push': \$option"
275264
usage
276265
;;
277266
*)

0 commit comments

Comments
 (0)