Re: Fwd: Possible bug report: `git commit -ammend`
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Nov 15, 2013, 15:54 UTC
- Message-ID
- <vpqsiux1wz3.fsf@anie.imag.fr>
- In-Reply-To
- <CAMyx444wJeQUpxZmXmYx-mKE0kniO=ELo5HgzQ1unV4O15oxWw@mail.gmail.com>
rhys evans <rhys.evans@ft.com> writes:
Show 7 quoted lines
> 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.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/