From: Jeff King Date: Sat, 16 Nov 2013 04:02:14 GMT Subject: Re: Fwd: Possible bug report: `git commit -ammend` Message-ID: <20131116040214.GA24804@sigill.intra.peff.net> In-Reply-To: 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