{"thread":{"id":"35345","subject":"Fwd: Possible bug report: `git commit -ammend`","startedAt":"2013-11-15T15:44:18Z","lastAt":"2013-11-16T04:02:14Z","messageCount":4,"participants":["rhys evans","Matthieu Moy","Duy Nguyen","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"230683","messageId":"CAMyx444wJeQUpxZmXmYx-mKE0kniO=ELo5HgzQ1unV4O15oxWw@mail.gmail.com","threadId":"35345","inReplyTo":"CAMyx446B1U30RL9X7vOrY-u7fQ_cEqRJxn_M8Wn8PuOJhdO-1Q@mail.gmail.com","subject":"Fwd: Possible bug report: `git commit -ammend`","fromName":"rhys evans","fromEmail":"rhys.evans@ft.com","sentAt":"2013-11-15T15:44:18Z","receivedAt":"2013-11-15T15:44:18Z","isPatch":false,"sender":{"key":"rhys.evans@ft.com","avatar":null},"body":"I ran `git commit -ammend` on a repo where 1 out of 3 files changed\nwere staged for commit.\n\nI would've expected an error to be thrown due to the double typo but\ninstead it committed all 3 files with the message 'mend'.\n\nSo it looks like it interpreted it as `git commit -a -m 'mend'`.\n\nI'm running git 1.8.3.4 using iTerm 1.0.0 on OSX 10.9.\n\n-- \n\n------------------------------\nThis email was sent by a company owned by Pearson plc, registered office at \n80 Strand, London WC2R 0RL.  Registered in England and Wales with company \nnumber 53723.\n"},{"id":"230684","messageId":"vpqsiux1wz3.fsf@anie.imag.fr","threadId":"35345","inReplyTo":"CAMyx444wJeQUpxZmXmYx-mKE0kniO=ELo5HgzQ1unV4O15oxWw@mail.gmail.com","subject":"Re: Fwd: Possible bug report: `git commit -ammend`","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-11-15T15:54:56Z","receivedAt":"2013-11-15T15:54:56Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"rhys evans <rhys.evans@ft.com> writes:\n\n> I ran `git commit -ammend` on a repo where 1 out of 3 files changed\n> were staged for commit.\n>\n> I would've expected an error to be thrown due to the double typo but\n> instead it committed all 3 files with the message 'mend'.\n>\n> So it looks like it interpreted it as `git commit -a -m 'mend'`.\n\nYes. This is a rather widespread convention (e.g. rm -fr == rm -r -f).\nGit does a special-case for -amend to avoid confusion:\n\n  $ git commit -amend\n  error: did you mean `--amend` (with two dashes ?)\n\nBut it did not special-case the double-typo.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"230695","messageId":"CACsJy8Ckb+qdQFcTHPcAiRy_08Nxtz5Uh_9R+NXz4yixWR9DUQ@mail.gmail.com","threadId":"35345","inReplyTo":"vpqsiux1wz3.fsf@anie.imag.fr","subject":"Re: Fwd: Possible bug report: `git commit -ammend`","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2013-11-16T03:28:36Z","receivedAt":"2013-11-16T03:28:36Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Nov 15, 2013 at 10:54 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> rhys evans <rhys.evans@ft.com> writes:\n>\n>> I ran `git commit -ammend` on a repo where 1 out of 3 files changed\n>> were staged for commit.\n>>\n>> I would've expected an error to be thrown due to the double typo but\n>> instead it committed all 3 files with the message 'mend'.\n>>\n>> So it looks like it interpreted it as `git commit -a -m 'mend'`.\n>\n> Yes. This is a rather widespread convention (e.g. rm -fr == rm -r -f).\n> Git does a special-case for -amend to avoid confusion:\n>\n>   $ git commit -amend\n>   error: did you mean `--amend` (with two dashes ?)\n>\n> But it did not special-case the double-typo.\n\n\"-m\" taking a string without a space or '=' increases the risk of this\ntypo. If it does require '=' or ' ' after -m then -ammend is more\nlikely to be rejected. Anybody know why we should support -mabc,\nbesides convenient?\n-- \nDuy\n"},{"id":"230696","messageId":"20131116040214.GA24804@sigill.intra.peff.net","threadId":"35345","inReplyTo":"CACsJy8Ckb+qdQFcTHPcAiRy_08Nxtz5Uh_9R+NXz4yixWR9DUQ@mail.gmail.com","subject":"Re: Fwd: Possible bug report: `git commit -ammend`","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-11-16T04:02:14Z","receivedAt":"2013-11-16T04:02:14Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Nov 16, 2013 at 10:28:36AM +0700, Duy Nguyen wrote:\n\n> > Yes. This is a rather widespread convention (e.g. rm -fr == rm -r -f).\n> > Git does a special-case for -amend to avoid confusion:\n> >\n> >   $ git commit -amend\n> >   error: did you mean `--amend` (with two dashes ?)\n> >\n> > But it did not special-case the double-typo.\n> \n> \"-m\" taking a string without a space or '=' increases the risk of this\n> typo. If it does require '=' or ' ' after -m then -ammend is more\n> likely to be rejected. Anybody know why we should support -mabc,\n> besides convenient?\n\nFor flags with optional arguments, \"-m abc\" would not work (we do not\nknow if \"abc\" is the argument or the next flag). An example of such a\nflag is \"git status -uall\".\n\nWe could disallow it for mandatory options, but that would create an\ninconsistency in the option parsing.\n\nOther than that, I think it is mostly convenience and compatibility with\nother option-parsing systems.\n\n-Peff\n"}]}