git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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)
Previous: Junio C Hamano
Message 5 of 5 in “Better handling of erroneous git stash save "somemessage" --keep-index”
  1. Gunnlaugur Thor BriemFeb 26, 2013
  2. Junio C HamanoFeb 26, 2013
  3. Matthieu MoyFeb 26, 2013
  4. Junio C HamanoFeb 26, 2013
  5. Gunnlaugur Thor BriemFeb 26, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.