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

Re: [PATCH] stash: Learn to parse -m/--message like commit does

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 22, 2017, 04:44 UTC
Message-ID
<xmqqh8tmvs5j.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171121232643.8380-1-phil.hord@gmail.com>
Phil Hord <phil.hord@gmail.com> writes:
Show 14 quoted lines
> `git stash push -m foo` uses "foo" as the message for the stash. But
> `git stash push -m"foo"` does not parse successfully.  Similarly
> `git stash push --message="My stash message"` also fails.  Nothing
> in the documentation suggests this syntax should work, but it does
> work for `git commit`, and my fingers have learned this pattern long
> ago.
>
> Teach `git stash` to parse -mFoo and --message=Foo the same as
> `git commit` would do.
>
> Signed-off-by: Phil Hord <phil.hord@gmail.com>
> ---
>  git-stash.sh | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
Makes sense.  Thanks.

I wonder if you want to add a trivial test or two for this, if "git stash [save|push|nothing] -m foo" is already tested. It appears that t3903 already has a test that does 'push -m "test message"' and sees if that appears in the output of "list", which looks like the ideal place to do so.

Previous: Phil Hord
Message 3 of 3 in “stash: Learn to parse -m/--message like commit does”
  1. stash: Learn to parse -m/--message like commit doesPhil Hord, Nov 21, 2017
  2. doc: prefer 'stash push' instead of 'stash save'Phil Hord, Nov 21, 2017
  3. Junio C HamanoNov 22, 2017

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.