Junio C Hamano <gits...@pobox.com> writes:

> Gunnlaugur Thor Briem <gunnlau...@gmail.com> writes:
>> the command:
>> git stash save "some message" --keep-index
>> stashes everything, including the index, and adds the "--keep-index"
>> to the message. The manual labor of separating index hunks from hunks
>> to stash is lost. This is in version

Not lost, it's saved as part of the stash. "git stash pop --index" will
restore it.

>> This is a user error, of course (per the man page, parameters are not
>> accepted after the message). But it would be better handled by
>> erroring out, with a message like "git stash save does not permit
>> parameters after the stash message".
> Then the user cannot say
>       git stash save some message that consists of multiple words
> no?

I didn't even know that multi-words messages would be allowed this way.
That seems to me to be really weird indeed.

I can't say

  git commit -m multi word message

so why would people want to omit quotes for "git stash" is a total
mystery. That said, we can't deny it right now, to preserve backward

My feeling is that "git stash save" should learn a "-m, --message"
option analogous to the one of "git commit", and then the "message on
the command-line" syntax could be deprecated.

(One nice side effect would be that in the very long term, we may want
to allow "git stash save -- <pathspecs>" to do a limited stash)

But maybe it's not worth the effort, I don't know.

Matthieu Moy
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to