From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH] cherry-pick: detect bogus arguments to --mainline
Date: Wed, 15 Mar 2017 12:15:44 -0700 [thread overview]
Message-ID: <xmqq4lyufj1b.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170315165623.sniukjnhonf3uddy@sigill.intra.peff.net> (Jeff King's message of "Wed, 15 Mar 2017 12:56:23 -0400")
Jeff King <peff@peff.net> writes:
> 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.
prev parent reply other threads:[~2017-03-15 19:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 23:08 BUG: "git revert -m 0 <commit>" considered to be "git revert <commit>" Ævar Arnfjörð Bjarmason
2017-03-15 16:56 ` [PATCH] cherry-pick: detect bogus arguments to --mainline Jeff King
2017-03-15 19:15 ` Junio C Hamano [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4lyufj1b.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).