Re: Better handling of erroneous git stash save "somemessage" --keep-index
- From
Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
- Date
- Feb 26, 2013, 16:46 UTC
- Message-ID
- <CAPs+M8+5yXz59PiOKwFpkUZkOoR-LA+jt0CWEAPz9Eq9VnaAcQ@mail.gmail.com>
- In-Reply-To
- <7vwqtvm4yr.fsf@alter.siamese.dyndns.org>
On Tue, Feb 26, 2013 at 4:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Then the user cannot say > > git stash save some message that consists of multiple words > > no? You may have a WIP to enhance the behaviour of one option and > you might want to say > > git stash save wip: tweak behaviour of --keep-index > > to save it away when switching to higher priority task.
In this case (which must be rarer than --keep-index intended as a parameter) the user gets the error message, the problem is pretty clear, and the workaround is very easy, quote the message:
git stash save "wip: tweak behaviour of --keep-index"
... which also is more conventional on the command line.
To minimize the behavior change, it could apply solely for the case of known parameters to this command (like --keep-index), so that:
git stash save wip: tweak behaviour of --froob-nob
would still work like before. That's less consistent, but then again, this is just a matter of catching very likely errors to avoid lost work.
Expressing a multi-word message without quotes on the command line is unconventional (in general, though maybe not in the use of git-stash) so it seems reasonable to let that usage be the one that gets inconvenienced.
-Gulli
(Sorry about the initial reply to you alone Junio)