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

Re: [PATCH] cherry-pick: detect bogus arguments to --mainline

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 15, 2017, 19:15 UTC
Message-ID
<xmqq4lyufj1b.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170315165623.sniukjnhonf3uddy@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> The "0" comes from the initialization of the replay_opts struct (it also
> happens if you explicitly disclaim any previous option with
> --no-mainline).
>
> I think using 0 as a sentinel is OK here, but the option-parser should
> complain when we go out of range. Like this:

An alternative could be to use -1 as a sentinel and clean it up after parse_options() returns, but then we will see another "bug" report that says "cherry-pick -m -1" gives a bad error message, which essentially is the same "bug" report as the one that triggered this change, which says the error message from "cherry-pick -m 0" is wrong X-<.

The "RANGE" thing is certainly tempting, but let's do so after we find multiple places that can benefit from it.

Will queue; thanks.
Previous: Jeff King
Message 3 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.