public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Quentin Bernet <quentin.bernet@bluewin.ch>
Cc: Mirko Faina <mroik@delayed.space>,
	 "D. Ben Knoble" <ben.knoble@gmail.com>,
	 Quentin Bernet via GitGitGadget <gitgitgadget@gmail.com>,
	 git@vger.kernel.org
Subject: Re: [PATCH] docs: fix git stash grammar
Date: Fri, 27 Mar 2026 10:16:50 -0700	[thread overview]
Message-ID: <xmqqtsu1jipp.fsf@gitster.g> (raw)
In-Reply-To: <9d0befb7-4f2b-4b47-bf9c-784fcacfe418@bluewin.ch> (Quentin Bernet's message of "Fri, 27 Mar 2026 17:58:19 +0100")

Quentin Bernet <quentin.bernet@bluewin.ch> writes:

> Just so we're clear: my previous grammar did allow "git stash path1 
> path2" (no "push", no "--"), which is not allowed
> Do you still think it is good enough ?

Absolutely.

It is not huge enough issue to warrant separating synopsis form for
push into two almost identical pairs, and having to maintain both of
them.  It would be sufficient to make sure the readers understand
that they may have to disambiguate pathspec with "--" like any other
command (like "git log foo" when you have both file "foo" and tag
"foo") in the description part.

One thing that we may want to fix in the code is that we probably do
not want to require "--" when doing something like

    git stash -m foo <pathspec>

to assume that it is a lazy "push" that does not say "push".
Currently we complain against the lack of subcommand name.

Once "-m" (i.e., a potential option) is seen before seeing any
subcommand, we can commit to treat it as a lazy "push", and have the
parser pretend as if we got

    git stash push -m foo <pathspec>

We may see "git stash -m foo --no-such-option garbage arge" and the
option and argument parser of "git stash push" becomes responsible
for complaining about such a command line.

#leftoverbits obviously.


  reply	other threads:[~2026-03-27 17:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 12:45 [PATCH] docs: fix git stash grammar Quentin Bernet via GitGitGadget
2026-03-26 16:17 ` D. Ben Knoble
2026-03-27  0:04   ` Mirko Faina
2026-03-27 15:58     ` Junio C Hamano
2026-03-27 16:28       ` Quentin Bernet
2026-03-27 16:53         ` Junio C Hamano
2026-03-27 16:58           ` Quentin Bernet
2026-03-27 17:16             ` Junio C Hamano [this message]
2026-03-27 17:36               ` Quentin Bernet
2026-03-27 17:45                 ` Junio C Hamano
2026-03-27 16:47     ` Ben Knoble
2026-03-27  8:25   ` Quentin Bernet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtsu1jipp.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=mroik@delayed.space \
    --cc=quentin.bernet@bluewin.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox