Skip to contentSkip to conversation

git stash save <message>

PATCH In review Thomas Singer 5 participants 7 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Where can I find information about what content in <message> is (not) allowed? We've got a bug-report where a SmartGit user has simply entered a minus and Git refused to work. Of course, entering just a minus is quite useless, but we have to be able to reliable detect allowed and disallowed messages. Should every message with a leading minus be rejected? Maybe the best would be to add a new command line option, e.g. --message before the <message>, so one can provide anything as message?

--
Best regards,
Thomas Singer
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com

#1 lore raw
Quoted 5 lines · Thomas Singer

Where can I find information about what content in <message> is (not) allowed? We've got a bug-report where a SmartGit user has simply entered a minus and Git refused to work. Of course, entering just a minus is quite useless, but we have to be able to reliable detect allowed and disallowed messages.

Does SmartGit call 'git stash save' behind the scenes with the user-supplied message? Then it should run

git stash save -- "$msg"

and you don't need to forbid anything.

-- Hannes

#2 lore raw
Quoted 6 lines · Johannes Sixt

Does SmartGit call 'git stash save' behind the scenes with the user-supplied message? Then it should run

git stash save -- "$msg"

and you don't need to forbid anything.

Thank you very much, this solved the problem.

Tom

#3 lore raw

PATCH 1/1 stash: suggest the correct command line for unknown options.

---

Quoted 8 lines
Quoted 6 lines

Does SmartGit call 'git stash save' behind the scenes with the user-supplied message? Then it should run

git stash save -- "$msg"

and you don't need to forbid anything.

Thank you very much, this solved the problem.

... unless one considers that the problem is that you had to ask. Something like this should avoid others the problem.

 git-stash.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
git-stash.sh +1 -0
index 2d69196..cf4e673 100755
@@ -151,6 +151,7 @@ save_stash () {
 			;;
 		-*)
 			echo "error: unknown option for 'stash save': $1"
+			echo "       To provide a message, use 'git stash -- $1'."
 			usage
 			;;
 		*)
Signature · 1 line
1.7.0.231.g9fa6.dirty
#4 lore raw

Re: [PATCH] stash: suggest the correct command line for unknown options.

git-stash.sh save_stash () { · line 154

Quoted 9 lines · Matthieu Moy
git-stash.sh +1 -0
index 2d69196..cf4e673 100755
@@ -151,6 +151,7 @@ save_stash () {
 			;;
 		-*)
 			echo "error: unknown option for 'stash save': $1"
+			echo "       To provide a message, use 'git stash -- $1'."

Don't you mean "git stash save -- $1"?

-Peff

#5 lore raw

PATCH v2 1/1 stash: suggest the correct command line for unknown options.

---
Oups, as noticed by peff, my proposed command was wrong ...

 git-stash.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
git-stash.sh +1 -0
index 2d69196..aa47e54 100755
@@ -151,6 +151,7 @@ save_stash () {
 			;;
 		-*)
 			echo "error: unknown option for 'stash save': $1"
+			echo "       To provide a message, use git stash save -- '$1'"
 			usage
 			;;
 		*)
Signature · 1 line
1.7.0.231.g9fa6.dirty
#6 lore raw

Re: [PATCH v2] stash: suggest the correct command line for unknown options.

Thanks.