grep: reject --no-or

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. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Sep 7, 2023 at 22:20 UTC aae8558b1038de452acee672dffca30339f65fa9
1 file changed +1 -1
builtin/grep.c
+1 -1
@@ -976,7 +976,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
976 OPT_CALLBACK_F(0, "and", &opt, NULL,
977 N_("combine patterns specified with -e"),
978 PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback),
979 - OPT_BOOL(0, "or", &dummy, ""),
979 + OPT_BOOL_F(0, "or", &dummy, "", PARSE_OPT_NONEG),
980 OPT_CALLBACK_F(0, "not", &opt, NULL, "",
981 PARSE_OPT_NOARG | PARSE_OPT_NONEG, not_callback),
982 OPT_CALLBACK_F('(', NULL, &opt, NULL, "",