{"thread":{"id":"45484","subject":"Bug: Revert with -m 0 says no -m was given","startedAt":"2017-03-23T17:17:50Z","lastAt":"2017-03-23T21:39:13Z","messageCount":4,"participants":["Ulrik Sverdrup","Junio C Hamano","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"315120","messageId":"12e6fae3-a341-3dcd-0920-c3df2d54d0a8@gmail.com","threadId":"45484","inReplyTo":null,"subject":"Bug: Revert with -m 0 says no -m was given","fromName":"Ulrik Sverdrup","fromEmail":"ulrik.sverdrup@gmail.com","sentAt":"2017-03-23T17:17:40Z","receivedAt":"2017-03-23T17:17:50Z","isPatch":false,"sender":{"key":"ulrik.sverdrup@gmail.com","avatar":null},"body":"Hi,\n\nGit produces a misleading error when you tell it `git revert -m 0`. The\nuser error is that the parent should be greater than zero, but git\ndoesn't help you. (I forgot that the first parent is 1 and not 0.)\n\n$ git revert -m 0 abc\nerror: commit abc... is a merge but no -m option was given.\nfatal: revert failed\n\nGit already handles too large m correctly:\n\n$ git revert -m 3 abc\nerror: commit abc... does not have parent 3\nfatal: revert failed\n\n-Ulrik\n"},{"id":"315136","messageId":"xmqq4lyjeu5m.fsf@gitster.mtv.corp.google.com","threadId":"45484","inReplyTo":"12e6fae3-a341-3dcd-0920-c3df2d54d0a8@gmail.com","subject":"Re: Bug: Revert with -m 0 says no -m was given","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-23T18:15:49Z","receivedAt":"2017-03-23T18:16:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ulrik Sverdrup <ulrik.sverdrup@gmail.com> writes:\n\n> Git produces a misleading error when you tell it `git revert -m 0`.\n\nThanks.  \n\nI think this is the same issue as the one with 'cherry-pick' that\nwas reported earlier.  We have a fix in the 'master' branch already;\nplease try it out.\n\n\n\n"},{"id":"315175","messageId":"CACBZZX5e-p4gKSWxehhVnnSgApC9H2v_ud+1Drz-vu_OAZwCgg@mail.gmail.com","threadId":"45484","inReplyTo":"xmqq4lyjeu5m.fsf@gitster.mtv.corp.google.com","subject":"Re: Bug: Revert with -m 0 says no -m was given","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-03-23T20:39:41Z","receivedAt":"2017-03-23T20:40:12Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Mar 23, 2017 at 7:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Ulrik Sverdrup <ulrik.sverdrup@gmail.com> writes:\n>\n>> Git produces a misleading error when you tell it `git revert -m 0`.\n>\n> Thanks.\n>\n> I think this is the same issue as the one with 'cherry-pick' that\n> was reported earlier.  We have a fix in the 'master' branch already;\n> please try it out.\n\nSpecifically, in master:\n\n$ ./git revert afd6726309\nerror: commit afd6726309f57f532b4b989a75c1392359c611cc is a merge but\nno -m option was given.\nfatal: revert failed\n$ ./git revert -m 0 afd6726309\nerror: option `mainline' expects a number greater than zero\n"},{"id":"315193","messageId":"xmqqmvcbad1q.fsf@gitster.mtv.corp.google.com","threadId":"45484","inReplyTo":"CACBZZX5e-p4gKSWxehhVnnSgApC9H2v_ud+1Drz-vu_OAZwCgg@mail.gmail.com","subject":"Re: Bug: Revert with -m 0 says no -m was given","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-23T21:38:57Z","receivedAt":"2017-03-23T21:39:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Thu, Mar 23, 2017 at 7:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Ulrik Sverdrup <ulrik.sverdrup@gmail.com> writes:\n>>\n>>> Git produces a misleading error when you tell it `git revert -m 0`.\n>>\n>> Thanks.\n>>\n>> I think this is the same issue as the one with 'cherry-pick' that\n>> was reported earlier.  We have a fix in the 'master' branch already;\n>> please try it out.\n>\n> Specifically, in master:\n>\n> $ ./git revert afd6726309\n> error: commit afd6726309f57f532b4b989a75c1392359c611cc is a merge but\n> no -m option was given.\n> fatal: revert failed\n> $ ./git revert -m 0 afd6726309\n> error: option `mainline' expects a number greater than zero\n\nYes, exactly.\n\nThanks.\n"}]}