]> git.ipfire.org Git - thirdparty/git.git/commitdiff
format-patch: mark "--no-numbered" option with NONEG
authorJeff King <peff@peff.net>
Mon, 5 Nov 2018 06:41:12 +0000 (01:41 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Nov 2018 03:55:36 +0000 (12:55 +0900)
We have separate parse-options entries for "numbered" and "no-numbered",
which means that we accept "--no-no-numbered". It does not behave
sensibly, though (it ignores the "unset" flag and acts like
"--no-numbered").

We could fix that, but obviously this is silly and unintentional. Let's
just disallow it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c

index 061d4fd864f3fb479e2877e3bbf25928ad1fb9d3..41188e723cc1f259caf5b0c4399cd9745455f1b1 100644 (file)
@@ -1508,7 +1508,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                            PARSE_OPT_NOARG, numbered_callback },
                { OPTION_CALLBACK, 'N', "no-numbered", &numbered, NULL,
                            N_("use [PATCH] even with multiple patches"),
-                           PARSE_OPT_NOARG, no_numbered_callback },
+                           PARSE_OPT_NOARG | PARSE_OPT_NONEG, no_numbered_callback },
                OPT_BOOL('s', "signoff", &do_signoff, N_("add Signed-off-by:")),
                OPT_BOOL(0, "stdout", &use_stdout,
                            N_("print patches to standard out")),