show-branch: mark --reflog option as NONEG
authorJeff King <peff@peff.net>
Mon, 5 Nov 2018 06:42:40 +0000 (01:42 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Nov 2018 03:55:36 +0000 (12:55 +0900)
Running "git show-branch --no-reflog" will behave as if "--reflog" was
given with no options, which makes no sense.

In theory this option might be used to cancel an earlier "--reflog"
option, but the semantics are not clear. Let's punt on it and just
disallow the broken option.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/show-branch.c
index 65f4a4c83c42ec33d5ffe3f1d83d7b5465c0796d..b1b540f7f6cf90a8cec3816ffa4404449b9e5bb4 100644 (file)
@@ -674,7 +674,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                { OPTION_CALLBACK, 'g', "reflog", &reflog_base, N_("<n>[,<base>]"),
                            N_("show <n> most recent ref-log entries starting at "
                               "base"),
-                           PARSE_OPT_OPTARG,
+                           PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
                            parse_reflog_param },
                OPT_END()
        };