From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
rhys evans <rhys.evans@ft.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Fwd: Possible bug report: `git commit -ammend`
Date: Fri, 15 Nov 2013 23:02:14 -0500 [thread overview]
Message-ID: <20131116040214.GA24804@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8Ckb+qdQFcTHPcAiRy_08Nxtz5Uh_9R+NXz4yixWR9DUQ@mail.gmail.com>
On Sat, Nov 16, 2013 at 10:28:36AM +0700, Duy Nguyen wrote:
> > Yes. This is a rather widespread convention (e.g. rm -fr == rm -r -f).
> > Git does a special-case for -amend to avoid confusion:
> >
> > $ git commit -amend
> > error: did you mean `--amend` (with two dashes ?)
> >
> > But it did not special-case the double-typo.
>
> "-m" taking a string without a space or '=' increases the risk of this
> typo. If it does require '=' or ' ' after -m then -ammend is more
> likely to be rejected. Anybody know why we should support -mabc,
> besides convenient?
For flags with optional arguments, "-m abc" would not work (we do not
know if "abc" is the argument or the next flag). An example of such a
flag is "git status -uall".
We could disallow it for mandatory options, but that would create an
inconsistency in the option parsing.
Other than that, I think it is mostly convenience and compatibility with
other option-parsing systems.
-Peff
prev parent reply other threads:[~2013-11-16 4:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAMyx446B1U30RL9X7vOrY-u7fQ_cEqRJxn_M8Wn8PuOJhdO-1Q@mail.gmail.com>
2013-11-15 15:44 ` Fwd: Possible bug report: `git commit -ammend` rhys evans
2013-11-15 15:54 ` Matthieu Moy
2013-11-16 3:28 ` Duy Nguyen
2013-11-16 4:02 ` Jeff King [this message]
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=20131116040214.GA24804@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=rhys.evans@ft.com \
/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;
as well as URLs for NNTP newsgroup(s).