parse-options: disallow negating OPTION_SET_INT 0
commit3284b93862b0aaea9d8e708f0aabd53e3e94409e
authorRené Scharfe <l.s.r@web.de>
Tue, 8 Aug 2023 20:05:57 +0000 (8 22:05 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Aug 2023 23:55:07 +0000 (8 16:55 -0700)
tree0028d3725ccd9869b34890f3e0a76a90dbfdd6b5
parentac83bc5054c2ac489166072334b4147ce6d0fccb
parse-options: disallow negating OPTION_SET_INT 0

An option of type OPTION_SET_INT can be defined to set its variable to
zero.  It's negated variant will do the same, though, which is
confusing.  Several such options were fixed by disabling negation,
changing the value to set or using a different option type:

991c552916 (ls-tree: fix --no-full-name, 2023-07-18)
e12cb98e1e (branch: reject "--no-all" and "--no-remotes" early, 2023-07-18)
68cbb20e73 (show-branch: reject --[no-](topo|date)-order, 2023-07-19)
3821eb6c3d (reset: reject --no-(mixed|soft|hard|merge|keep) option, 2023-07-19)
36f76d2a25 (pack-objects: fix --no-quiet, 2023-07-21)
3a5f308741 (pack-objects: fix --no-keep-true-parents, 2023-07-21)
c95ae3ff9c (describe: fix --no-exact-match, 2023-07-21)
d089a06421 (bundle: use OPT_PASSTHRU_ARGV, 2023-07-29)

Check for such options that allow negation in parse_options_check() and
report them to find future cases quicker.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c