Skip to content

Commit d5d09d4

Browse files
stefanbellergitster
authored andcommitted
Replace deprecated OPT_BOOLEAN by OPT_BOOL
This task emerged from b04ba2b (parse-options: deprecate OPT_BOOLEAN, 2011-09-27). All occurrences of the respective variables have been reviewed and none of them relied on the counting up mechanism, but all of them were using the variable as a true boolean. This patch does not change semantics of any command intentionally. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4741edd commit d5d09d4

39 files changed

+227
-227
lines changed

builtin/apply.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4363,23 +4363,23 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
43634363
{ OPTION_CALLBACK, 'p', NULL, NULL, N_("num"),
43644364
N_("remove <num> leading slashes from traditional diff paths"),
43654365
0, option_parse_p },
4366-
OPT_BOOLEAN(0, "no-add", &no_add,
4366+
OPT_BOOL(0, "no-add", &no_add,
43674367
N_("ignore additions made by the patch")),
4368-
OPT_BOOLEAN(0, "stat", &diffstat,
4368+
OPT_BOOL(0, "stat", &diffstat,
43694369
N_("instead of applying the patch, output diffstat for the input")),
43704370
OPT_NOOP_NOARG(0, "allow-binary-replacement"),
43714371
OPT_NOOP_NOARG(0, "binary"),
4372-
OPT_BOOLEAN(0, "numstat", &numstat,
4372+
OPT_BOOL(0, "numstat", &numstat,
43734373
N_("show number of added and deleted lines in decimal notation")),
4374-
OPT_BOOLEAN(0, "summary", &summary,
4374+
OPT_BOOL(0, "summary", &summary,
43754375
N_("instead of applying the patch, output a summary for the input")),
4376-
OPT_BOOLEAN(0, "check", &check,
4376+
OPT_BOOL(0, "check", &check,
43774377
N_("instead of applying the patch, see if the patch is applicable")),
4378-
OPT_BOOLEAN(0, "index", &check_index,
4378+
OPT_BOOL(0, "index", &check_index,
43794379
N_("make sure the patch is applicable to the current index")),
4380-
OPT_BOOLEAN(0, "cached", &cached,
4380+
OPT_BOOL(0, "cached", &cached,
43814381
N_("apply a patch without touching the working tree")),
4382-
OPT_BOOLEAN(0, "apply", &force_apply,
4382+
OPT_BOOL(0, "apply", &force_apply,
43834383
N_("also apply the patch (use with --stat/--summary/--check)")),
43844384
OPT_BOOL('3', "3way", &threeway,
43854385
N_( "attempt three-way merge if a patch does not apply")),
@@ -4399,13 +4399,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
43994399
{ OPTION_CALLBACK, 0, "ignore-whitespace", NULL, NULL,
44004400
N_("ignore changes in whitespace when finding context"),
44014401
PARSE_OPT_NOARG, option_parse_space_change },
4402-
OPT_BOOLEAN('R', "reverse", &apply_in_reverse,
4402+
OPT_BOOL('R', "reverse", &apply_in_reverse,
44034403
N_("apply the patch in reverse")),
4404-
OPT_BOOLEAN(0, "unidiff-zero", &unidiff_zero,
4404+
OPT_BOOL(0, "unidiff-zero", &unidiff_zero,
44054405
N_("don't expect at least one line of context")),
4406-
OPT_BOOLEAN(0, "reject", &apply_with_reject,
4406+
OPT_BOOL(0, "reject", &apply_with_reject,
44074407
N_("leave the rejected hunks in corresponding *.rej files")),
4408-
OPT_BOOLEAN(0, "allow-overlap", &allow_overlap,
4408+
OPT_BOOL(0, "allow-overlap", &allow_overlap,
44094409
N_("allow overlapping hunks")),
44104410
OPT__VERBOSE(&apply_verbosely, N_("be verbose")),
44114411
OPT_BIT(0, "inaccurate-eof", &options,

builtin/bisect--helper.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
1313
int next_all = 0;
1414
int no_checkout = 0;
1515
struct option options[] = {
16-
OPT_BOOLEAN(0, "next-all", &next_all,
17-
N_("perform 'git bisect next'")),
18-
OPT_BOOLEAN(0, "no-checkout", &no_checkout,
19-
N_("update BISECT_HEAD instead of checking out the current commit")),
16+
OPT_BOOL(0, "next-all", &next_all,
17+
N_("perform 'git bisect next'")),
18+
OPT_BOOL(0, "no-checkout", &no_checkout,
19+
N_("update BISECT_HEAD instead of checking out the current commit")),
2020
OPT_END()
2121
};
2222

builtin/blame.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,10 +2273,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
22732273
static const char *revs_file = NULL;
22742274
static const char *contents_from = NULL;
22752275
static const struct option options[] = {
2276-
OPT_BOOLEAN(0, "incremental", &incremental, N_("Show blame entries as we find them, incrementally")),
2277-
OPT_BOOLEAN('b', NULL, &blank_boundary, N_("Show blank SHA-1 for boundary commits (Default: off)")),
2278-
OPT_BOOLEAN(0, "root", &show_root, N_("Do not treat root commits as boundaries (Default: off)")),
2279-
OPT_BOOLEAN(0, "show-stats", &show_stats, N_("Show work cost statistics")),
2276+
OPT_BOOL(0, "incremental", &incremental, N_("Show blame entries as we find them, incrementally")),
2277+
OPT_BOOL('b', NULL, &blank_boundary, N_("Show blank SHA-1 for boundary commits (Default: off)")),
2278+
OPT_BOOL(0, "root", &show_root, N_("Do not treat root commits as boundaries (Default: off)")),
2279+
OPT_BOOL(0, "show-stats", &show_stats, N_("Show work cost statistics")),
22802280
OPT_BIT(0, "score-debug", &output_option, N_("Show output score for blame entries"), OUTPUT_SHOW_SCORE),
22812281
OPT_BIT('f', "show-name", &output_option, N_("Show original filename (Default: auto)"), OUTPUT_SHOW_NAME),
22822282
OPT_BIT('n', "show-number", &output_option, N_("Show original linenumber (Default: off)"), OUTPUT_SHOW_NUMBER),

builtin/branch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
797797
OPT_SET_INT( 0, "set-upstream", &track, N_("change upstream info"),
798798
BRANCH_TRACK_OVERRIDE),
799799
OPT_STRING('u', "set-upstream-to", &new_upstream, "upstream", "change the upstream info"),
800-
OPT_BOOLEAN(0, "unset-upstream", &unset_upstream, "Unset the upstream info"),
800+
OPT_BOOL(0, "unset-upstream", &unset_upstream, "Unset the upstream info"),
801801
OPT__COLOR(&branch_use_color, N_("use colored output")),
802802
OPT_SET_INT('r', "remotes", &kinds, N_("act on remote-tracking branches"),
803803
REF_REMOTE_BRANCH),
@@ -822,10 +822,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
822822
OPT_BIT('D', NULL, &delete, N_("delete branch (even if not merged)"), 2),
823823
OPT_BIT('m', "move", &rename, N_("move/rename a branch and its reflog"), 1),
824824
OPT_BIT('M', NULL, &rename, N_("move/rename a branch, even if target exists"), 2),
825-
OPT_BOOLEAN(0, "list", &list, N_("list branch names")),
826-
OPT_BOOLEAN('l', "create-reflog", &reflog, N_("create the branch's reflog")),
827-
OPT_BOOLEAN(0, "edit-description", &edit_description,
828-
N_("edit the description for the branch")),
825+
OPT_BOOL(0, "list", &list, N_("list branch names")),
826+
OPT_BOOL('l', "create-reflog", &reflog, N_("create the branch's reflog")),
827+
OPT_BOOL(0, "edit-description", &edit_description,
828+
N_("edit the description for the branch")),
829829
OPT__FORCE(&force_create, N_("force creation (when already exists)")),
830830
{
831831
OPTION_CALLBACK, 0, "no-merged", &merge_filter_ref,

builtin/check-attr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ NULL
1616
static int null_term_line;
1717

1818
static const struct option check_attr_options[] = {
19-
OPT_BOOLEAN('a', "all", &all_attrs, N_("report all attributes set on file")),
20-
OPT_BOOLEAN(0, "cached", &cached_attrs, N_("use .gitattributes only from the index")),
21-
OPT_BOOLEAN(0 , "stdin", &stdin_paths, N_("read file names from stdin")),
22-
OPT_BOOLEAN('z', NULL, &null_term_line,
19+
OPT_BOOL('a', "all", &all_attrs, N_("report all attributes set on file")),
20+
OPT_BOOL(0, "cached", &cached_attrs, N_("use .gitattributes only from the index")),
21+
OPT_BOOL(0 , "stdin", &stdin_paths, N_("read file names from stdin")),
22+
OPT_BOOL('z', NULL, &null_term_line,
2323
N_("input paths are terminated by a null character")),
2424
OPT_END()
2525
};

builtin/check-ignore.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ static const struct option check_ignore_options[] = {
1818
OPT__QUIET(&quiet, N_("suppress progress reporting")),
1919
OPT__VERBOSE(&verbose, N_("be verbose")),
2020
OPT_GROUP(""),
21-
OPT_BOOLEAN(0, "stdin", &stdin_paths,
22-
N_("read file names from stdin")),
23-
OPT_BOOLEAN('z', NULL, &null_term_line,
24-
N_("input paths are terminated by a null character")),
25-
OPT_BOOLEAN('n', "non-matching", &show_non_matching,
26-
N_("show non-matching input paths")),
21+
OPT_BOOL(0, "stdin", &stdin_paths,
22+
N_("read file names from stdin")),
23+
OPT_BOOL('z', NULL, &null_term_line,
24+
N_("input paths are terminated by a null character")),
25+
OPT_BOOL('n', "non-matching", &show_non_matching,
26+
N_("show non-matching input paths")),
2727
OPT_END()
2828
};
2929

builtin/checkout-index.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
183183
int prefix_length;
184184
int force = 0, quiet = 0, not_new = 0;
185185
struct option builtin_checkout_index_options[] = {
186-
OPT_BOOLEAN('a', "all", &all,
186+
OPT_BOOL('a', "all", &all,
187187
N_("check out all files in the index")),
188188
OPT__FORCE(&force, N_("force overwrite of existing files")),
189189
OPT__QUIET(&quiet,
@@ -196,9 +196,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
196196
{ OPTION_CALLBACK, 'z', NULL, NULL, NULL,
197197
N_("paths are separated with NUL character"),
198198
PARSE_OPT_NOARG, option_parse_z },
199-
OPT_BOOLEAN(0, "stdin", &read_from_stdin,
199+
OPT_BOOL(0, "stdin", &read_from_stdin,
200200
N_("read list of paths from the standard input")),
201-
OPT_BOOLEAN(0, "temp", &to_tempfile,
201+
OPT_BOOL(0, "temp", &to_tempfile,
202202
N_("write the content to temporary files")),
203203
OPT_CALLBACK(0, "prefix", NULL, N_("string"),
204204
N_("when creating files, prepend <string>"),

builtin/checkout.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
10561056
N_("create and checkout a new branch")),
10571057
OPT_STRING('B', NULL, &opts.new_branch_force, N_("branch"),
10581058
N_("create/reset and checkout a branch")),
1059-
OPT_BOOLEAN('l', NULL, &opts.new_branch_log, N_("create reflog for new branch")),
1060-
OPT_BOOLEAN(0, "detach", &opts.force_detach, N_("detach the HEAD at named commit")),
1059+
OPT_BOOL('l', NULL, &opts.new_branch_log, N_("create reflog for new branch")),
1060+
OPT_BOOL(0, "detach", &opts.force_detach, N_("detach the HEAD at named commit")),
10611061
OPT_SET_INT('t', "track", &opts.track, N_("set upstream info for new branch"),
10621062
BRANCH_TRACK_EXPLICIT),
10631063
OPT_STRING(0, "orphan", &opts.new_orphan_branch, N_("new branch"), N_("new unparented branch")),
@@ -1066,11 +1066,11 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
10661066
OPT_SET_INT('3', "theirs", &opts.writeout_stage, N_("checkout their version for unmerged files"),
10671067
3),
10681068
OPT__FORCE(&opts.force, N_("force checkout (throw away local modifications)")),
1069-
OPT_BOOLEAN('m', "merge", &opts.merge, N_("perform a 3-way merge with the new branch")),
1070-
OPT_BOOLEAN(0, "overwrite-ignore", &opts.overwrite_ignore, N_("update ignored files (default)")),
1069+
OPT_BOOL('m', "merge", &opts.merge, N_("perform a 3-way merge with the new branch")),
1070+
OPT_BOOL(0, "overwrite-ignore", &opts.overwrite_ignore, N_("update ignored files (default)")),
10711071
OPT_STRING(0, "conflict", &conflict_style, N_("style"),
10721072
N_("conflict style (merge or diff3)")),
1073-
OPT_BOOLEAN('p', "patch", &opts.patch_mode, N_("select hunks interactively")),
1073+
OPT_BOOL('p', "patch", &opts.patch_mode, N_("select hunks interactively")),
10741074
OPT_BOOL(0, "ignore-skip-worktree-bits", &opts.ignore_skipworktree,
10751075
N_("do not limit pathspecs to sparse entries only")),
10761076
OPT_HIDDEN_BOOL(0, "guess", &dwim_new_local_branch,

builtin/clean.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,12 +851,12 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
851851
OPT__DRY_RUN(&dry_run, N_("dry run")),
852852
OPT__FORCE(&force, N_("force")),
853853
OPT_BOOL('i', "interactive", &interactive, N_("interactive cleaning")),
854-
OPT_BOOLEAN('d', NULL, &remove_directories,
854+
OPT_BOOL('d', NULL, &remove_directories,
855855
N_("remove whole directories")),
856856
{ OPTION_CALLBACK, 'e', "exclude", &exclude_list, N_("pattern"),
857857
N_("add <pattern> to ignore rules"), PARSE_OPT_NONEG, exclude_cb },
858-
OPT_BOOLEAN('x', NULL, &ignored, N_("remove ignored files, too")),
859-
OPT_BOOLEAN('X', NULL, &ignored_only,
858+
OPT_BOOL('x', NULL, &ignored, N_("remove ignored files, too")),
859+
OPT_BOOL('X', NULL, &ignored_only,
860860
N_("remove only ignored files")),
861861
OPT_END()
862862
};

builtin/clone.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ static struct option builtin_clone_options[] = {
6262
OPT__VERBOSITY(&option_verbosity),
6363
OPT_BOOL(0, "progress", &option_progress,
6464
N_("force progress reporting")),
65-
OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
66-
N_("don't create a checkout")),
65+
OPT_BOOL('n', "no-checkout", &option_no_checkout,
66+
N_("don't create a checkout")),
6767
OPT_BOOL(0, "bare", &option_bare, N_("create a bare repository")),
6868
OPT_HIDDEN_BOOL(0, "naked", &option_bare,
6969
N_("create a bare repository")),
70-
OPT_BOOLEAN(0, "mirror", &option_mirror,
71-
N_("create a mirror repository (implies bare)")),
70+
OPT_BOOL(0, "mirror", &option_mirror,
71+
N_("create a mirror repository (implies bare)")),
7272
OPT_BOOL('l', "local", &option_local,
7373
N_("to clone from a local repository")),
74-
OPT_BOOLEAN(0, "no-hardlinks", &option_no_hardlinks,
74+
OPT_BOOL(0, "no-hardlinks", &option_no_hardlinks,
7575
N_("don't use local hardlinks, always copy")),
76-
OPT_BOOLEAN('s', "shared", &option_shared,
76+
OPT_BOOL('s', "shared", &option_shared,
7777
N_("setup as shared repository")),
78-
OPT_BOOLEAN(0, "recursive", &option_recursive,
78+
OPT_BOOL(0, "recursive", &option_recursive,
7979
N_("initialize submodules in the clone")),
80-
OPT_BOOLEAN(0, "recurse-submodules", &option_recursive,
80+
OPT_BOOL(0, "recurse-submodules", &option_recursive,
8181
N_("initialize submodules in the clone")),
8282
OPT_STRING(0, "template", &option_template, N_("template-directory"),
8383
N_("directory from which templates will be used")),

0 commit comments

Comments
 (0)