From: Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
To: git@vger.kernel.org
Subject: Bug: Revert with -m 0 says no -m was given
Date: Thu, 23 Mar 2017 18:17:40 +0100 [thread overview]
Message-ID: <12e6fae3-a341-3dcd-0920-c3df2d54d0a8@gmail.com> (raw)
Hi,
Git produces a misleading error when you tell it `git revert -m 0`. The
user error is that the parent should be greater than zero, but git
doesn't help you. (I forgot that the first parent is 1 and not 0.)
$ git revert -m 0 abc
error: commit abc... is a merge but no -m option was given.
fatal: revert failed
Git already handles too large m correctly:
$ git revert -m 3 abc
error: commit abc... does not have parent 3
fatal: revert failed
-Ulrik
next reply other threads:[~2017-03-23 17:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 17:17 Ulrik Sverdrup [this message]
2017-03-23 18:15 ` Bug: Revert with -m 0 says no -m was given Junio C Hamano
2017-03-23 20:39 ` Ævar Arnfjörð Bjarmason
2017-03-23 21:38 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12e6fae3-a341-3dcd-0920-c3df2d54d0a8@gmail.com \
--to=ulrik.sverdrup@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).