From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] grep: reject --no-or
Date: Thu, 07 Sep 2023 13:34:54 -0700 [thread overview]
Message-ID: <xmqqh6o5k9ht.fsf@gitster.g> (raw)
In-Reply-To: <6aeb0ebe-0fea-ccd3-089a-ee0b5b5baf10@web.de> ("René Scharfe"'s message of "Thu, 7 Sep 2023 22:20:59 +0200")
René Scharfe <l.s.r@web.de> writes:
> Since 3e230fa1b2 (grep: use parseopt, 2009-05-07) git grep has been
> accepting the option --no-or. It does the same as --or: nothing.
> That's confusing and unintended. Forbid negating --or.
OK. It is just a no-op Boolean but that is not a good reason for us
to be loose. Will queue. Thanks.
>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
> builtin/grep.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/grep.c b/builtin/grep.c
> index 50e712a184..2a261074f1 100644
> --- a/builtin/grep.c
> +++ b/builtin/grep.c
> @@ -990,7 +990,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
> OPT_CALLBACK_F(0, "and", &opt, NULL,
> N_("combine patterns specified with -e"),
> PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback),
> - OPT_BOOL(0, "or", &dummy, ""),
> + OPT_BOOL_F(0, "or", &dummy, "", PARSE_OPT_NONEG),
> OPT_CALLBACK_F(0, "not", &opt, NULL, "",
> PARSE_OPT_NOARG | PARSE_OPT_NONEG, not_callback),
> OPT_CALLBACK_F('(', NULL, &opt, NULL, "",
> --
> 2.42.0
prev parent reply other threads:[~2023-09-07 20:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 20:20 [PATCH] grep: reject --no-or René Scharfe
2023-09-07 20:34 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqh6o5k9ht.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
/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).