git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bug: Revert with -m 0 says no -m was given

From
USUlrik Sverdrup <ulrik.sverdrup@gmail.com>
Date
Mar 23, 2017, 17:17 UTC
Message-ID
<12e6fae3-a341-3dcd-0920-c3df2d54d0a8@gmail.com>
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: Junio C Hamano
Message 1 of 4 in “Bug: Revert with -m 0 says no -m was given”
  1. Ulrik SverdrupMar 23, 2017
  2. Junio C HamanoMar 23, 2017
  3. Ævar Arnfjörð BjarmasonMar 23, 2017
  4. Junio C HamanoMar 23, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.