# git stash save <message>

7 messages from 2010-03-05 to 2010-03-07. Participants: Thomas Singer, Johannes Sixt, Matthieu Moy, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/22918

## Thomas Singer, 2010-03-05 12:16

Subject: git stash save <message>
Message-ID: <4B90F636.2030300@syntevo.com>
URL: https://gitlist.dev/e/4B90F636.2030300%40syntevo.com

```
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

```

## Johannes Sixt, 2010-03-05 12:55

Subject: Re: git stash save <message>
Message-ID: <4B90FF40.4020607@viscovery.net>
URL: https://gitlist.dev/e/4B90FF40.4020607%40viscovery.net
In-Reply-To: <4B90F636.2030300@syntevo.com>

```
Thomas Singer schrieb:
> 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

```

## Thomas Singer, 2010-03-05 13:29

Subject: Re: git stash save <message>
Message-ID: <4B910736.7060604@syntevo.com>
URL: https://gitlist.dev/e/4B910736.7060604%40syntevo.com
In-Reply-To: <4B90FF40.4020607@viscovery.net>

```
On 05.03.2010 13:55, Johannes Sixt wrote:
> 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

```

## Matthieu Moy, 2010-03-05 16:14

Subject: [PATCH] stash: suggest the correct command line for unknown options.
Message-ID: <1267805693-25206-1-git-send-email-Matthieu.Moy@imag.fr>
URL: https://gitlist.dev/e/1267805693-25206-1-git-send-email-Matthieu.Moy%40imag.fr
In-Reply-To: <4B910736.7060604@syntevo.com>

```

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
> > 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(-)

diff --git a/git-stash.sh b/git-stash.sh
index 2d69196..cf4e673 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -151,6 +151,7 @@ save_stash () {
 			;;
 		-*)
 			echo "error: unknown option for 'stash save': $1"
+			echo "       To provide a message, use 'git stash -- $1'."
 			usage
 			;;
 		*)
-- 
1.7.0.231.g9fa6.dirty

```

## Jeff King, 2010-03-05 17:08

Subject: Re: [PATCH] stash: suggest the correct command line for unknown options.
Message-ID: <20100305170841.GA9325@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20100305170841.GA9325%40coredump.intra.peff.net
In-Reply-To: <1267805693-25206-1-git-send-email-Matthieu.Moy@imag.fr>

```
On Fri, Mar 05, 2010 at 05:14:53PM +0100, Matthieu Moy wrote:

> diff --git a/git-stash.sh b/git-stash.sh
> index 2d69196..cf4e673 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -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

```

## Matthieu Moy, 2010-03-05 18:43

Subject: [PATCH v2] stash: suggest the correct command line for unknown options.
Message-ID: <1267814603-26158-1-git-send-email-Matthieu.Moy@imag.fr>
URL: https://gitlist.dev/e/1267814603-26158-1-git-send-email-Matthieu.Moy%40imag.fr
In-Reply-To: <20100305170841.GA9325@coredump.intra.peff.net>

```

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Oups, as noticed by peff, my proposed command was wrong ...

 git-stash.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index 2d69196..aa47e54 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -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
 			;;
 		*)
-- 
1.7.0.231.g9fa6.dirty

```

## Junio C Hamano, 2010-03-07 04:01

Subject: Re: [PATCH v2] stash: suggest the correct command line for unknown options.
Message-ID: <7v1vfwbx14.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v1vfwbx14.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1267814603-26158-1-git-send-email-Matthieu.Moy@imag.fr>

```
Thanks.

```
