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

BUG: "git revert -m 0 <commit>" considered to be "git revert <commit>"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 14, 2017, 23:08 UTC
Message-ID
<CACBZZX7Um==4pWfUVcLM8Kbk-ry8HQAmDoUVGjVPmhY3ZXUNYg@mail.gmail.com>

Both of these emit the "is a merge but no -m option was given" when <commit> is a merge.

I tried to track this down for a bit in the options parsing code but couldn't see where it was happening, but at some point we're setting opts->mainline to 0 both when it's not provided, and when it's explicitly provided as 0.

Instead we should e.g. pass "no option" through as NULL to the sequencer, and emit some better error about how -m isn't zero-indexed.

Next: Jeff King
Message 1 of 3 in “BUG: "git revert -m 0 <commit>" considered to be "git revert <commit>"”
  1. Ævar Arnfjörð BjarmasonMar 14, 2017
  2. cherry-pick: detect bogus arguments to --mainlineJeff King, Mar 15, 2017
  3. Junio C HamanoMar 15, 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.