Re: Fwd: Possible bug report: `git commit -ammend`
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Nov 16, 2013, 03:28 UTC
- Message-ID
- <CACsJy8Ckb+qdQFcTHPcAiRy_08Nxtz5Uh_9R+NXz4yixWR9DUQ@mail.gmail.com>
- In-Reply-To
- <vpqsiux1wz3.fsf@anie.imag.fr>
On Fri, Nov 15, 2013 at 10:54 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 17 quoted lines
> rhys evans <rhys.evans@ft.com> writes: > >> I ran `git commit -ammend` on a repo where 1 out of 3 files changed >> were staged for commit. >> >> I would've expected an error to be thrown due to the double typo but >> instead it committed all 3 files with the message 'mend'. >> >> So it looks like it interpreted it as `git commit -a -m 'mend'`. > > 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?
-- Duy