From: Junio C Hamano Date: Wed, 4 Sep 2013 19:39:02 +0000 (-0700) Subject: Merge branch 'sb/parseopt-boolean-removal' X-Git-Tag: v1.8.5-rc0~178 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a86a8b9 Merge branch 'sb/parseopt-boolean-removal' Convert most uses of OPT_BOOLEAN/OPTION_BOOLEAN that can use OPT_BOOL/OPTION_BOOLEAN which have much saner semantics, and turn remaining ones into OPT_SET_INT, OPT_COUNTUP, etc. as necessary. * sb/parseopt-boolean-removal: revert: use the OPT_CMDMODE for parsing, reducing code checkout-index: fix negations of even numbers of -n config parsing options: allow one flag multiple times hash-object: replace stdin parsing OPT_BOOLEAN by OPT_COUNTUP branch, commit, name-rev: ease up boolean conditions checkout: remove superfluous local variable log, format-patch: parsing uses OPT__QUIET Replace deprecated OPT_BOOLEAN by OPT_BOOL Remove deprecated OPTION_BOOLEAN for parsing arguments --- a86a8b9752d5abb7d0e6cd69017170e826d41fb5 diff --cc builtin/check-attr.c index cd46690ec7,6e5cd886af..e9af7b2bfb --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@@ -13,14 -13,14 +13,14 @@@ N_("git check-attr --stdin [-z] [-a | - NULL }; -static int null_term_line; +static int nul_term_line; static const struct option check_attr_options[] = { - OPT_BOOLEAN('a', "all", &all_attrs, N_("report all attributes set on file")), - OPT_BOOLEAN(0, "cached", &cached_attrs, N_("use .gitattributes only from the index")), - OPT_BOOLEAN(0 , "stdin", &stdin_paths, N_("read file names from stdin")), - OPT_BOOLEAN('z', NULL, &nul_term_line, - N_("terminate input and output records by a NUL character")), + OPT_BOOL('a', "all", &all_attrs, N_("report all attributes set on file")), + OPT_BOOL(0, "cached", &cached_attrs, N_("use .gitattributes only from the index")), + OPT_BOOL(0 , "stdin", &stdin_paths, N_("read file names from stdin")), - OPT_BOOL('z', NULL, &null_term_line, - N_("input paths are terminated by a null character")), ++ OPT_BOOL('z', NULL, &nul_term_line, ++ N_("terminate input and output records by a NUL character")), OPT_END() }; diff --cc builtin/check-ignore.c index 503a559b18,c9f0c9bd6a..25aa2a5f4c --- a/builtin/check-ignore.c +++ b/builtin/check-ignore.c @@@ -18,12 -18,12 +18,12 @@@ static const struct option check_ignore OPT__QUIET(&quiet, N_("suppress progress reporting")), OPT__VERBOSE(&verbose, N_("be verbose")), OPT_GROUP(""), - OPT_BOOLEAN(0, "stdin", &stdin_paths, - N_("read file names from stdin")), - OPT_BOOLEAN('z', NULL, &nul_term_line, - N_("terminate input and output records by a NUL character")), - OPT_BOOLEAN('n', "non-matching", &show_non_matching, - N_("show non-matching input paths")), + OPT_BOOL(0, "stdin", &stdin_paths, + N_("read file names from stdin")), - OPT_BOOL('z', NULL, &null_term_line, - N_("input paths are terminated by a null character")), ++ OPT_BOOL('z', NULL, &nul_term_line, ++ N_("terminate input and output records by a NUL character")), + OPT_BOOL('n', "non-matching", &show_non_matching, + N_("show non-matching input paths")), OPT_END() }; diff --cc builtin/gc.c index 6e0d81ab32,c4f7390bcf..891a2c2ecb --- a/builtin/gc.c +++ b/builtin/gc.c @@@ -236,9 -178,8 +236,9 @@@ int cmd_gc(int argc, const char **argv { OPTION_STRING, 0, "prune", &prune_expire, N_("date"), N_("prune unreferenced objects"), PARSE_OPT_OPTARG, NULL, (intptr_t)prune_expire }, - OPT_BOOLEAN(0, "aggressive", &aggressive, N_("be more thorough (increased runtime)")), - OPT_BOOLEAN(0, "auto", &auto_gc, N_("enable auto-gc mode")), + OPT_BOOL(0, "aggressive", &aggressive, N_("be more thorough (increased runtime)")), + OPT_BOOL(0, "auto", &auto_gc, N_("enable auto-gc mode")), + OPT_BOOL(0, "force", &force, N_("force running gc even if there may be another gc running")), OPT_END() };