From: Ævar Arnfjörð Bjarmason Date: Fri, 24 Mar 2017 18:40:53 +0000 (+0000) Subject: parse-options: add OPT_NONEG to the "contains" option X-Git-Tag: v2.13.0-rc0~33^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eab98ee5ab84def96012f115a8e10571c6e24e4e;p=thirdparty%2Fgit.git parse-options: add OPT_NONEG to the "contains" option Add the OPT_NONEG flag to the "contains" option and its hidden synonym "with". Since this was added in commit 694a577519 ("git-branch --contains=commit", 2007-11-07) giving --no-{contains,with} hasn't been an error, but has emitted the help output since filter.with_commit wouldn't get set. Now git will emit "error: unknown option `no-{contains,with}'" at the top of the help output. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- diff --git a/parse-options.h b/parse-options.h index dcd8a0926c..9f48f554ba 100644 --- a/parse-options.h +++ b/parse-options.h @@ -258,7 +258,7 @@ extern int parse_opt_passthru_argv(const struct option *, const char *, int); PARSE_OPT_LASTARG_DEFAULT | flag, \ parse_opt_commits, (intptr_t) "HEAD" \ } -#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, 0) -#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN) +#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, PARSE_OPT_NONEG) +#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN | PARSE_OPT_NONEG) #endif