]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'sb/parseopt-boolean-removal'
authorJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2013 19:39:02 +0000 (12:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2013 19:39:03 +0000 (12:39 -0700)
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

1  2 
builtin/check-attr.c
builtin/check-ignore.c
builtin/clean.c
builtin/commit.c
builtin/fast-export.c
builtin/gc.c
builtin/push.c
builtin/rev-parse.c
builtin/rm.c
parse-options.h

index cd46690ec71531cf5fd475814e3423d3f428025d,6e5cd886af286f6f8dcb80c2d041181f8c0a51c8..e9af7b2bfb932d75cdface880be9814885068a50
@@@ -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()
  };
  
index 503a559b18bf03aa7d78c2b408289da6297e0cff,c9f0c9bd6ad59384f01edf1d58b21bbbc5e501dc..25aa2a5f4c7ff0d0394e4df8e5e761ae916055f6
@@@ -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/clean.c
Simple merge
Simple merge
Simple merge
diff --cc builtin/gc.c
index 6e0d81ab32aa691d24dc86ba30f3bc282bdc2890,c4f7390bcf8a6a86feaa6eab678a24403da6b56a..891a2c2ecb046dc29b2d9ce8b9d2982084bf9b19
@@@ -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()
        };
  
diff --cc builtin/push.c
Simple merge
Simple merge
diff --cc builtin/rm.c
Simple merge
diff --cc parse-options.h
Simple merge