{"thread":{"id":"34561","subject":"[PATCH 0/4] Removing deprecated parsing macros","startedAt":"2013-07-29T19:49:54Z","lastAt":"2013-07-31T10:35:08Z","messageCount":7,"participants":["Stefan Beller","René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"224258","messageId":"1375127398-31904-1-git-send-email-stefanbeller@googlemail.com","threadId":"34561","inReplyTo":null,"subject":"[PATCH 0/4] Removing deprecated parsing macros","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-29T19:49:54Z","receivedAt":"2013-07-29T19:49:54Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"The first patch of this series is a start on replacing\nthe deprecated OPT_BOOLEAN macro by OPT_BOOL.\nAll occurences have been reviewed so far, only 140 occurences to go.\n\nThe 3 patches after the first are things I noticed during the\nreview for the macro replacement. These should ease readability.\n\nI'll continue replaceing macros the next days, this series is\nfor review only.\n\nStefan Beller (4):\n  Replace deprecated OPT_BOOLEAN by OPT_BOOL\n  log, format-patch: also accept short parameter 'q' to be quiet\n  checkout: remove superfluous local variable\n  name-rev: ease up condition\n\n builtin/check-attr.c |  8 ++++----\n builtin/checkout.c   | 22 ++++++++++------------\n builtin/clone.c      | 16 ++++++++--------\n builtin/fsck.c       | 16 ++++++++--------\n builtin/grep.c       | 36 ++++++++++++++++++------------------\n builtin/log.c        | 14 +++++++-------\n builtin/ls-tree.c    |  6 +++---\n builtin/merge-file.c |  2 +-\n builtin/merge.c      | 12 ++++++------\n builtin/mv.c         |  2 +-\n builtin/name-rev.c   | 14 +++++++-------\n builtin/notes.c      |  4 ++--\n builtin/replace.c    |  6 +++---\n builtin/reset.c      |  2 +-\n builtin/rev-parse.c  |  4 ++--\n 15 files changed, 81 insertions(+), 83 deletions(-)\n\n-- \n1.8.4.rc0.1.g8f6a3e5\n"},{"id":"224259","messageId":"1375127398-31904-2-git-send-email-stefanbeller@googlemail.com","threadId":"34561","inReplyTo":"1375127398-31904-1-git-send-email-stefanbeller@googlemail.com","subject":"[PATCH 1/4] Replace deprecated OPT_BOOLEAN by OPT_BOOL","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-29T19:49:55Z","receivedAt":"2013-07-29T19:49:55Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This task emerged from b04ba2bb4.\nAll occurrences of the respective variables have been reviewed and none\nof them relied on the counting up mechanism, but all of them were\nusing the variable as a true boolean.\n\nSigned-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n builtin/check-attr.c |  8 ++++----\n builtin/checkout.c   | 10 +++++-----\n builtin/clone.c      | 16 ++++++++--------\n builtin/fsck.c       | 16 ++++++++--------\n builtin/grep.c       | 36 ++++++++++++++++++------------------\n builtin/log.c        | 12 ++++++------\n builtin/ls-tree.c    |  6 +++---\n builtin/merge-file.c |  2 +-\n builtin/merge.c      | 12 ++++++------\n builtin/mv.c         |  2 +-\n builtin/name-rev.c   | 12 ++++++------\n builtin/notes.c      |  4 ++--\n builtin/replace.c    |  6 +++---\n builtin/reset.c      |  2 +-\n builtin/rev-parse.c  |  4 ++--\n 15 files changed, 74 insertions(+), 74 deletions(-)\n\ndiff --git a/builtin/check-attr.c b/builtin/check-attr.c\nindex 075d01d..6e5cd88 100644\n--- a/builtin/check-attr.c\n+++ b/builtin/check-attr.c\n@@ -16,10 +16,10 @@ NULL\n static int null_term_line;\n \n static const struct option check_attr_options[] = {\n-\tOPT_BOOLEAN('a', \"all\", &all_attrs, N_(\"report all attributes set on file\")),\n-\tOPT_BOOLEAN(0,  \"cached\", &cached_attrs, N_(\"use .gitattributes only from the index\")),\n-\tOPT_BOOLEAN(0 , \"stdin\", &stdin_paths, N_(\"read file names from stdin\")),\n-\tOPT_BOOLEAN('z', NULL, &null_term_line,\n+\tOPT_BOOL('a', \"all\", &all_attrs, N_(\"report all attributes set on file\")),\n+\tOPT_BOOL(0,  \"cached\", &cached_attrs, N_(\"use .gitattributes only from the index\")),\n+\tOPT_BOOL(0 , \"stdin\", &stdin_paths, N_(\"read file names from stdin\")),\n+\tOPT_BOOL('z', NULL, &null_term_line,\n \t\tN_(\"input paths are terminated by a null character\")),\n \tOPT_END()\n };\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 646a475..8b48f4a 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -1056,8 +1056,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t\t\t   N_(\"create and checkout a new branch\")),\n \t\tOPT_STRING('B', NULL, &opts.new_branch_force, N_(\"branch\"),\n \t\t\t   N_(\"create/reset and checkout a branch\")),\n-\t\tOPT_BOOLEAN('l', NULL, &opts.new_branch_log, N_(\"create reflog for new branch\")),\n-\t\tOPT_BOOLEAN(0, \"detach\", &opts.force_detach, N_(\"detach the HEAD at named commit\")),\n+\t\tOPT_BOOL('l', NULL, &opts.new_branch_log, N_(\"create reflog for new branch\")),\n+\t\tOPT_BOOL(0, \"detach\", &opts.force_detach, N_(\"detach the HEAD at named commit\")),\n \t\tOPT_SET_INT('t', \"track\",  &opts.track, N_(\"set upstream info for new branch\"),\n \t\t\tBRANCH_TRACK_EXPLICIT),\n \t\tOPT_STRING(0, \"orphan\", &opts.new_orphan_branch, N_(\"new branch\"), N_(\"new unparented branch\")),\n@@ -1066,11 +1066,11 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t\tOPT_SET_INT('3', \"theirs\", &opts.writeout_stage, N_(\"checkout their version for unmerged files\"),\n \t\t\t    3),\n \t\tOPT__FORCE(&opts.force, N_(\"force checkout (throw away local modifications)\")),\n-\t\tOPT_BOOLEAN('m', \"merge\", &opts.merge, N_(\"perform a 3-way merge with the new branch\")),\n-\t\tOPT_BOOLEAN(0, \"overwrite-ignore\", &opts.overwrite_ignore, N_(\"update ignored files (default)\")),\n+\t\tOPT_BOOL('m', \"merge\", &opts.merge, N_(\"perform a 3-way merge with the new branch\")),\n+\t\tOPT_BOOL(0, \"overwrite-ignore\", &opts.overwrite_ignore, N_(\"update ignored files (default)\")),\n \t\tOPT_STRING(0, \"conflict\", &conflict_style, N_(\"style\"),\n \t\t\t   N_(\"conflict style (merge or diff3)\")),\n-\t\tOPT_BOOLEAN('p', \"patch\", &opts.patch_mode, N_(\"select hunks interactively\")),\n+\t\tOPT_BOOL('p', \"patch\", &opts.patch_mode, N_(\"select hunks interactively\")),\n \t\tOPT_BOOL(0, \"ignore-skip-worktree-bits\", &opts.ignore_skipworktree,\n \t\t\t N_(\"do not limit pathspecs to sparse entries only\")),\n \t\tOPT_HIDDEN_BOOL(0, \"guess\", &dwim_new_local_branch,\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex e7b0b13..ca3eb68 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -62,22 +62,22 @@ static struct option builtin_clone_options[] = {\n \tOPT__VERBOSITY(&option_verbosity),\n \tOPT_BOOL(0, \"progress\", &option_progress,\n \t\t N_(\"force progress reporting\")),\n-\tOPT_BOOLEAN('n', \"no-checkout\", &option_no_checkout,\n-\t\t    N_(\"don't create a checkout\")),\n+\tOPT_BOOL('n', \"no-checkout\", &option_no_checkout,\n+\t\t N_(\"don't create a checkout\")),\n \tOPT_BOOL(0, \"bare\", &option_bare, N_(\"create a bare repository\")),\n \tOPT_HIDDEN_BOOL(0, \"naked\", &option_bare,\n \t\t\tN_(\"create a bare repository\")),\n-\tOPT_BOOLEAN(0, \"mirror\", &option_mirror,\n-\t\t    N_(\"create a mirror repository (implies bare)\")),\n+\tOPT_BOOL(0, \"mirror\", &option_mirror,\n+\t\t N_(\"create a mirror repository (implies bare)\")),\n \tOPT_BOOL('l', \"local\", &option_local,\n \t\tN_(\"to clone from a local repository\")),\n-\tOPT_BOOLEAN(0, \"no-hardlinks\", &option_no_hardlinks,\n+\tOPT_BOOL(0, \"no-hardlinks\", &option_no_hardlinks,\n \t\t    N_(\"don't use local hardlinks, always copy\")),\n-\tOPT_BOOLEAN('s', \"shared\", &option_shared,\n+\tOPT_BOOL('s', \"shared\", &option_shared,\n \t\t    N_(\"setup as shared repository\")),\n-\tOPT_BOOLEAN(0, \"recursive\", &option_recursive,\n+\tOPT_BOOL(0, \"recursive\", &option_recursive,\n \t\t    N_(\"initialize submodules in the clone\")),\n-\tOPT_BOOLEAN(0, \"recurse-submodules\", &option_recursive,\n+\tOPT_BOOL(0, \"recurse-submodules\", &option_recursive,\n \t\t    N_(\"initialize submodules in the clone\")),\n \tOPT_STRING(0, \"template\", &option_template, N_(\"template-directory\"),\n \t\t   N_(\"directory from which templates will be used\")),\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 9909b6d..39fa5e8 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -611,15 +611,15 @@ static char const * const fsck_usage[] = {\n \n static struct option fsck_opts[] = {\n \tOPT__VERBOSE(&verbose, N_(\"be verbose\")),\n-\tOPT_BOOLEAN(0, \"unreachable\", &show_unreachable, N_(\"show unreachable objects\")),\n+\tOPT_BOOL(0, \"unreachable\", &show_unreachable, N_(\"show unreachable objects\")),\n \tOPT_BOOL(0, \"dangling\", &show_dangling, N_(\"show dangling objects\")),\n-\tOPT_BOOLEAN(0, \"tags\", &show_tags, N_(\"report tags\")),\n-\tOPT_BOOLEAN(0, \"root\", &show_root, N_(\"report root nodes\")),\n-\tOPT_BOOLEAN(0, \"cache\", &keep_cache_objects, N_(\"make index objects head nodes\")),\n-\tOPT_BOOLEAN(0, \"reflogs\", &include_reflogs, N_(\"make reflogs head nodes (default)\")),\n-\tOPT_BOOLEAN(0, \"full\", &check_full, N_(\"also consider packs and alternate objects\")),\n-\tOPT_BOOLEAN(0, \"strict\", &check_strict, N_(\"enable more strict checking\")),\n-\tOPT_BOOLEAN(0, \"lost-found\", &write_lost_and_found,\n+\tOPT_BOOL(0, \"tags\", &show_tags, N_(\"report tags\")),\n+\tOPT_BOOL(0, \"root\", &show_root, N_(\"report root nodes\")),\n+\tOPT_BOOL(0, \"cache\", &keep_cache_objects, N_(\"make index objects head nodes\")),\n+\tOPT_BOOL(0, \"reflogs\", &include_reflogs, N_(\"make reflogs head nodes (default)\")),\n+\tOPT_BOOL(0, \"full\", &check_full, N_(\"also consider packs and alternate objects\")),\n+\tOPT_BOOL(0, \"strict\", &check_strict, N_(\"enable more strict checking\")),\n+\tOPT_BOOL(0, \"lost-found\", &write_lost_and_found,\n \t\t\t\tN_(\"write dangling objects in .git/lost-found\")),\n \tOPT_BOOL(0, \"progress\", &show_progress, N_(\"show progress\")),\n \tOPT_END(),\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d3b3b1d..03c2e93 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -638,20 +638,20 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \tint pattern_type_arg = GREP_PATTERN_TYPE_UNSPECIFIED;\n \n \tstruct option options[] = {\n-\t\tOPT_BOOLEAN(0, \"cached\", &cached,\n+\t\tOPT_BOOL(0, \"cached\", &cached,\n \t\t\tN_(\"search in index instead of in the work tree\")),\n \t\tOPT_NEGBIT(0, \"no-index\", &use_index,\n \t\t\t N_(\"find in contents not managed by git\"), 1),\n-\t\tOPT_BOOLEAN(0, \"untracked\", &untracked,\n+\t\tOPT_BOOL(0, \"untracked\", &untracked,\n \t\t\tN_(\"search in both tracked and untracked files\")),\n \t\tOPT_SET_INT(0, \"exclude-standard\", &opt_exclude,\n \t\t\t    N_(\"search also in ignored files\"), 1),\n \t\tOPT_GROUP(\"\"),\n-\t\tOPT_BOOLEAN('v', \"invert-match\", &opt.invert,\n+\t\tOPT_BOOL('v', \"invert-match\", &opt.invert,\n \t\t\tN_(\"show non-matching lines\")),\n-\t\tOPT_BOOLEAN('i', \"ignore-case\", &opt.ignore_case,\n+\t\tOPT_BOOL('i', \"ignore-case\", &opt.ignore_case,\n \t\t\tN_(\"case insensitive matching\")),\n-\t\tOPT_BOOLEAN('w', \"word-regexp\", &opt.word_regexp,\n+\t\tOPT_BOOL('w', \"word-regexp\", &opt.word_regexp,\n \t\t\tN_(\"match patterns only at word boundaries\")),\n \t\tOPT_SET_INT('a', \"text\", &opt.binary,\n \t\t\tN_(\"process binary files as text\"), GREP_BINARY_TEXT),\n@@ -675,26 +675,26 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t\t    N_(\"use Perl-compatible regular expressions\"),\n \t\t\t    GREP_PATTERN_TYPE_PCRE),\n \t\tOPT_GROUP(\"\"),\n-\t\tOPT_BOOLEAN('n', \"line-number\", &opt.linenum, N_(\"show line numbers\")),\n+\t\tOPT_BOOL('n', \"line-number\", &opt.linenum, N_(\"show line numbers\")),\n \t\tOPT_NEGBIT('h', NULL, &opt.pathname, N_(\"don't show filenames\"), 1),\n \t\tOPT_BIT('H', NULL, &opt.pathname, N_(\"show filenames\"), 1),\n \t\tOPT_NEGBIT(0, \"full-name\", &opt.relative,\n \t\t\tN_(\"show filenames relative to top directory\"), 1),\n-\t\tOPT_BOOLEAN('l', \"files-with-matches\", &opt.name_only,\n+\t\tOPT_BOOL('l', \"files-with-matches\", &opt.name_only,\n \t\t\tN_(\"show only filenames instead of matching lines\")),\n-\t\tOPT_BOOLEAN(0, \"name-only\", &opt.name_only,\n+\t\tOPT_BOOL(0, \"name-only\", &opt.name_only,\n \t\t\tN_(\"synonym for --files-with-matches\")),\n-\t\tOPT_BOOLEAN('L', \"files-without-match\",\n+\t\tOPT_BOOL('L', \"files-without-match\",\n \t\t\t&opt.unmatch_name_only,\n \t\t\tN_(\"show only the names of files without match\")),\n-\t\tOPT_BOOLEAN('z', \"null\", &opt.null_following_name,\n+\t\tOPT_BOOL('z', \"null\", &opt.null_following_name,\n \t\t\tN_(\"print NUL after filenames\")),\n \t\tOPT_BOOLEAN('c', \"count\", &opt.count,\n \t\t\tN_(\"show the number of matches instead of matching lines\")),\n \t\tOPT__COLOR(&opt.color, N_(\"highlight matches\")),\n-\t\tOPT_BOOLEAN(0, \"break\", &opt.file_break,\n+\t\tOPT_BOOL(0, \"break\", &opt.file_break,\n \t\t\tN_(\"print empty line between matches from different files\")),\n-\t\tOPT_BOOLEAN(0, \"heading\", &opt.heading,\n+\t\tOPT_BOOL(0, \"heading\", &opt.heading,\n \t\t\tN_(\"show filename only once above matches from same file\")),\n \t\tOPT_GROUP(\"\"),\n \t\tOPT_CALLBACK('C', \"context\", &opt, N_(\"n\"),\n@@ -706,9 +706,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t\tN_(\"show <n> context lines after matches\")),\n \t\tOPT_NUMBER_CALLBACK(&opt, N_(\"shortcut for -C NUM\"),\n \t\t\tcontext_callback),\n-\t\tOPT_BOOLEAN('p', \"show-function\", &opt.funcname,\n+\t\tOPT_BOOL('p', \"show-function\", &opt.funcname,\n \t\t\tN_(\"show a line with the function name before matches\")),\n-\t\tOPT_BOOLEAN('W', \"function-context\", &opt.funcbody,\n+\t\tOPT_BOOL('W', \"function-context\", &opt.funcbody,\n \t\t\tN_(\"show the surrounding function\")),\n \t\tOPT_GROUP(\"\"),\n \t\tOPT_CALLBACK('f', NULL, &opt, N_(\"file\"),\n@@ -718,7 +718,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t{ OPTION_CALLBACK, 0, \"and\", &opt, NULL,\n \t\t  N_(\"combine patterns specified with -e\"),\n \t\t  PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback },\n-\t\tOPT_BOOLEAN(0, \"or\", &dummy, \"\"),\n+\t\tOPT_BOOL(0, \"or\", &dummy, \"\"),\n \t\t{ OPTION_CALLBACK, 0, \"not\", &opt, NULL, \"\",\n \t\t  PARSE_OPT_NOARG | PARSE_OPT_NONEG, not_callback },\n \t\t{ OPTION_CALLBACK, '(', NULL, &opt, NULL, \"\",\n@@ -729,7 +729,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t  close_callback },\n \t\tOPT__QUIET(&opt.status_only,\n \t\t\t   N_(\"indicate hit with exit status without output\")),\n-\t\tOPT_BOOLEAN(0, \"all-match\", &opt.all_match,\n+\t\tOPT_BOOL(0, \"all-match\", &opt.all_match,\n \t\t\tN_(\"show only matches from files that match all patterns\")),\n \t\t{ OPTION_SET_INT, 0, \"debug\", &opt.debug, NULL,\n \t\t  N_(\"show parse tree for grep expression\"),\n@@ -738,8 +738,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\t{ OPTION_STRING, 'O', \"open-files-in-pager\", &show_in_pager,\n \t\t\tN_(\"pager\"), N_(\"show matching files in the pager\"),\n \t\t\tPARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },\n-\t\tOPT_BOOLEAN(0, \"ext-grep\", &external_grep_allowed__ignored,\n-\t\t\t    N_(\"allow calling of grep(1) (ignored by this build)\")),\n+\t\tOPT_BOOL(0, \"ext-grep\", &external_grep_allowed__ignored,\n+\t\t\t N_(\"allow calling of grep(1) (ignored by this build)\")),\n \t\t{ OPTION_CALLBACK, 0, \"help-all\", &options, NULL, N_(\"show usage\"),\n \t\t  PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },\n \t\tOPT_END()\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 05e374d..9b6c910 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1179,10 +1179,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t{ OPTION_CALLBACK, 'k', \"keep-subject\", &rev, NULL,\n \t\t\t    N_(\"don't strip/add [PATCH]\"),\n \t\t\t    PARSE_OPT_NOARG | PARSE_OPT_NONEG, keep_callback },\n-\t\tOPT_BOOLEAN(0, \"no-binary\", &no_binary_diff,\n-\t\t\t    N_(\"don't output binary diffs\")),\n-\t\tOPT_BOOLEAN(0, \"ignore-if-in-upstream\", &ignore_if_in_upstream,\n-\t\t\t    N_(\"don't include a patch matching a commit upstream\")),\n+\t\tOPT_BOOL(0, \"no-binary\", &no_binary_diff,\n+\t\t\t N_(\"don't output binary diffs\")),\n+\t\tOPT_BOOL(0, \"ignore-if-in-upstream\", &ignore_if_in_upstream,\n+\t\t\t N_(\"don't include a patch matching a commit upstream\")),\n \t\t{ OPTION_SET_INT, 'p', \"no-stat\", &use_patch_format, NULL,\n \t\t  N_(\"show patch format instead of default (patch + stat)\"),\n \t\t  PARSE_OPT_NONEG | PARSE_OPT_NOARG, NULL, 1},\n@@ -1210,8 +1210,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\t    PARSE_OPT_OPTARG, thread_callback },\n \t\tOPT_STRING(0, \"signature\", &signature, N_(\"signature\"),\n \t\t\t    N_(\"add a signature\")),\n-\t\tOPT_BOOLEAN(0, \"quiet\", &quiet,\n-\t\t\t    N_(\"don't print the patch filenames\")),\n+\t\tOPT_BOOL(0, \"quiet\", &quiet,\n+\t\t\t N_(\"don't print the patch filenames\")),\n \t\tOPT_END()\n \t};\n \ndiff --git a/builtin/ls-tree.c b/builtin/ls-tree.c\nindex fb76e38..de88563 100644\n--- a/builtin/ls-tree.c\n+++ b/builtin/ls-tree.c\n@@ -138,9 +138,9 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)\n \t\t\tLS_NAME_ONLY),\n \t\tOPT_SET_INT(0, \"full-name\", &chomp_prefix,\n \t\t\t    N_(\"use full path names\"), 0),\n-\t\tOPT_BOOLEAN(0, \"full-tree\", &full_tree,\n-\t\t\t    N_(\"list entire tree; not just current directory \"\n-\t\t\t       \"(implies --full-name)\")),\n+\t\tOPT_BOOL(0, \"full-tree\", &full_tree,\n+\t\t\t N_(\"list entire tree; not just current directory \"\n+\t\t\t    \"(implies --full-name)\")),\n \t\tOPT__ABBREV(&abbrev),\n \t\tOPT_END()\n \t};\ndiff --git a/builtin/merge-file.c b/builtin/merge-file.c\nindex c0570f2..844f84f 100644\n--- a/builtin/merge-file.c\n+++ b/builtin/merge-file.c\n@@ -30,7 +30,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \tint quiet = 0;\n \tint prefixlen = 0;\n \tstruct option options[] = {\n-\t\tOPT_BOOLEAN('p', \"stdout\", &to_stdout, N_(\"send results to standard output\")),\n+\t\tOPT_BOOL('p', \"stdout\", &to_stdout, N_(\"send results to standard output\")),\n \t\tOPT_SET_INT(0, \"diff3\", &xmp.style, N_(\"use a diff3 based merge\"), XDL_MERGE_DIFF3),\n \t\tOPT_SET_INT(0, \"ours\", &xmp.favor, N_(\"for conflicts, use our version\"),\n \t\t\t    XDL_MERGE_FAVOR_OURS),\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 34a6166..a8cf4a2 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -197,15 +197,15 @@ static struct option builtin_merge_options[] = {\n \t{ OPTION_CALLBACK, 'n', NULL, NULL, NULL,\n \t\tN_(\"do not show a diffstat at the end of the merge\"),\n \t\tPARSE_OPT_NOARG, option_parse_n },\n-\tOPT_BOOLEAN(0, \"stat\", &show_diffstat,\n+\tOPT_BOOL(0, \"stat\", &show_diffstat,\n \t\tN_(\"show a diffstat at the end of the merge\")),\n-\tOPT_BOOLEAN(0, \"summary\", &show_diffstat, N_(\"(synonym to --stat)\")),\n+\tOPT_BOOL(0, \"summary\", &show_diffstat, N_(\"(synonym to --stat)\")),\n \t{ OPTION_INTEGER, 0, \"log\", &shortlog_len, N_(\"n\"),\n \t  N_(\"add (at most <n>) entries from shortlog to merge commit message\"),\n \t  PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },\n-\tOPT_BOOLEAN(0, \"squash\", &squash,\n+\tOPT_BOOL(0, \"squash\", &squash,\n \t\tN_(\"create a single commit instead of doing a merge\")),\n-\tOPT_BOOLEAN(0, \"commit\", &option_commit,\n+\tOPT_BOOL(0, \"commit\", &option_commit,\n \t\tN_(\"perform a commit if the merge succeeds (default)\")),\n \tOPT_BOOL('e', \"edit\", &option_edit,\n \t\tN_(\"edit message before committing\")),\n@@ -224,12 +224,12 @@ static struct option builtin_merge_options[] = {\n \t\tN_(\"merge commit message (for a non-fast-forward merge)\"),\n \t\toption_parse_message),\n \tOPT__VERBOSITY(&verbosity),\n-\tOPT_BOOLEAN(0, \"abort\", &abort_current_merge,\n+\tOPT_BOOL(0, \"abort\", &abort_current_merge,\n \t\tN_(\"abort the current in-progress merge\")),\n \tOPT_SET_INT(0, \"progress\", &show_progress, N_(\"force progress reporting\"), 1),\n \t{ OPTION_STRING, 'S', \"gpg-sign\", &sign_commit, N_(\"key id\"),\n \t  N_(\"GPG sign commit\"), PARSE_OPT_OPTARG, NULL, (intptr_t) \"\" },\n-\tOPT_BOOLEAN(0, \"overwrite-ignore\", &overwrite_ignore, N_(\"update ignored files (default)\")),\n+\tOPT_BOOL(0, \"overwrite-ignore\", &overwrite_ignore, N_(\"update ignored files (default)\")),\n \tOPT_END()\n };\n \ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex 034fec9..be6fa77 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -62,7 +62,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tOPT__VERBOSE(&verbose, N_(\"be verbose\")),\n \t\tOPT__DRY_RUN(&show_only, N_(\"dry run\")),\n \t\tOPT__FORCE(&force, N_(\"force move/rename even if target exists\")),\n-\t\tOPT_BOOLEAN('k', NULL, &ignore_errors, N_(\"skip move/rename errors\")),\n+\t\tOPT_BOOL('k', NULL, &ignore_errors, N_(\"skip move/rename errors\")),\n \t\tOPT_END(),\n \t};\n \tconst char **source, **destination, **dest_path;\ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex 0aaa19e..a908a34 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -310,15 +310,15 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)\n \tint all = 0, transform_stdin = 0, allow_undefined = 1, always = 0, peel_tag = 0;\n \tstruct name_ref_data data = { 0, 0, NULL };\n \tstruct option opts[] = {\n-\t\tOPT_BOOLEAN(0, \"name-only\", &data.name_only, N_(\"print only names (no SHA-1)\")),\n-\t\tOPT_BOOLEAN(0, \"tags\", &data.tags_only, N_(\"only use tags to name the commits\")),\n+\t\tOPT_BOOL(0, \"name-only\", &data.name_only, N_(\"print only names (no SHA-1)\")),\n+\t\tOPT_BOOL(0, \"tags\", &data.tags_only, N_(\"only use tags to name the commits\")),\n \t\tOPT_STRING(0, \"refs\", &data.ref_filter, N_(\"pattern\"),\n \t\t\t\t   N_(\"only use refs matching <pattern>\")),\n \t\tOPT_GROUP(\"\"),\n-\t\tOPT_BOOLEAN(0, \"all\", &all, N_(\"list all commits reachable from all refs\")),\n-\t\tOPT_BOOLEAN(0, \"stdin\", &transform_stdin, N_(\"read from stdin\")),\n-\t\tOPT_BOOLEAN(0, \"undefined\", &allow_undefined, N_(\"allow to print `undefined` names\")),\n-\t\tOPT_BOOLEAN(0, \"always\",     &always,\n+\t\tOPT_BOOL(0, \"all\", &all, N_(\"list all commits reachable from all refs\")),\n+\t\tOPT_BOOL(0, \"stdin\", &transform_stdin, N_(\"read from stdin\")),\n+\t\tOPT_BOOL(0, \"undefined\", &allow_undefined, N_(\"allow to print `undefined` names (default)\")),\n+\t\tOPT_BOOL(0, \"always\",     &always,\n \t\t\t   N_(\"show abbreviated commit object as fallback\")),\n \t\t{\n \t\t\t/* A Hidden OPT_BOOL */\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 8f63cb2..d459e23 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -483,7 +483,7 @@ static int copy(int argc, const char **argv, const char *prefix)\n \tconst char *rewrite_cmd = NULL;\n \tstruct option options[] = {\n \t\tOPT__FORCE(&force, N_(\"replace existing notes\")),\n-\t\tOPT_BOOLEAN(0, \"stdin\", &from_stdin, N_(\"read objects from stdin\")),\n+\t\tOPT_BOOL(0, \"stdin\", &from_stdin, N_(\"read objects from stdin\")),\n \t\tOPT_STRING(0, \"for-rewrite\", &rewrite_cmd, N_(\"command\"),\n \t\t\t   N_(\"load rewriting config for <command> (implies \"\n \t\t\t      \"--stdin)\")),\n@@ -853,7 +853,7 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT(0, \"ignore-missing\", &flag,\n \t\t\tN_(\"attempt to remove non-existent note is not an error\"),\n \t\t\tIGNORE_MISSING),\n-\t\tOPT_BOOLEAN(0, \"stdin\", &from_stdin,\n+\t\tOPT_BOOL(0, \"stdin\", &from_stdin,\n \t\t\t    N_(\"read object names from the standard input\")),\n \t\tOPT_END()\n \t};\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 59d3115..11b0a55 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -118,9 +118,9 @@ int cmd_replace(int argc, const char **argv, const char *prefix)\n {\n \tint list = 0, delete = 0, force = 0;\n \tstruct option options[] = {\n-\t\tOPT_BOOLEAN('l', NULL, &list, N_(\"list replace refs\")),\n-\t\tOPT_BOOLEAN('d', NULL, &delete, N_(\"delete replace refs\")),\n-\t\tOPT_BOOLEAN('f', NULL, &force, N_(\"replace the ref if it exists\")),\n+\t\tOPT_BOOL('l', NULL, &list, N_(\"list replace refs\")),\n+\t\tOPT_BOOL('d', NULL, &delete, N_(\"delete replace refs\")),\n+\t\tOPT_BOOL('f', NULL, &force, N_(\"replace the ref if it exists\")),\n \t\tOPT_END()\n \t};\n \ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex afa6e02..0905815 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -258,7 +258,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\t\t\tN_(\"reset HEAD, index and working tree\"), MERGE),\n \t\tOPT_SET_INT(0, \"keep\", &reset_type,\n \t\t\t\tN_(\"reset HEAD but keep local changes\"), KEEP),\n-\t\tOPT_BOOLEAN('p', \"patch\", &patch_mode, N_(\"select hunks interactively\")),\n+\t\tOPT_BOOL('p', \"patch\", &patch_mode, N_(\"select hunks interactively\")),\n \t\tOPT_END()\n \t};\n \ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex de894c7..67e8ccf 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -346,9 +346,9 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)\n \t\tNULL\n \t};\n \tstatic struct option parseopt_opts[] = {\n-\t\tOPT_BOOLEAN(0, \"keep-dashdash\", &keep_dashdash,\n+\t\tOPT_BOOL(0, \"keep-dashdash\", &keep_dashdash,\n \t\t\t\t\tN_(\"keep the `--` passed as an arg\")),\n-\t\tOPT_BOOLEAN(0, \"stop-at-non-option\", &stop_at_non_option,\n+\t\tOPT_BOOL(0, \"stop-at-non-option\", &stop_at_non_option,\n \t\t\t\t\tN_(\"stop parsing after the \"\n \t\t\t\t\t   \"first non-option argument\")),\n \t\tOPT_END(),\n-- \n1.8.4.rc0.1.g8f6a3e5\n"},{"id":"224260","messageId":"1375127398-31904-3-git-send-email-stefanbeller@googlemail.com","threadId":"34561","inReplyTo":"1375127398-31904-1-git-send-email-stefanbeller@googlemail.com","subject":"[PATCH 2/4] log, format-patch: accept short parameter 'q' for quiet","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-29T19:49:56Z","receivedAt":"2013-07-29T19:49:56Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n builtin/log.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 9b6c910..5cb968b 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -121,7 +121,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,\n \tstatic struct line_opt_callback_data line_cb = {NULL, NULL, STRING_LIST_INIT_DUP};\n \n \tconst struct option builtin_log_options[] = {\n-\t\tOPT_BOOL(0, \"quiet\", &quiet, N_(\"suppress diff output\")),\n+\t\tOPT_BOOL('q', \"quiet\", &quiet, N_(\"suppress diff output\")),\n \t\tOPT_BOOL(0, \"source\", &source, N_(\"show source\")),\n \t\tOPT_BOOL(0, \"use-mailmap\", &mailmap, N_(\"Use mail map file\")),\n \t\t{ OPTION_CALLBACK, 0, \"decorate\", NULL, NULL, N_(\"decorate options\"),\n@@ -1210,7 +1210,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\t    PARSE_OPT_OPTARG, thread_callback },\n \t\tOPT_STRING(0, \"signature\", &signature, N_(\"signature\"),\n \t\t\t    N_(\"add a signature\")),\n-\t\tOPT_BOOL(0, \"quiet\", &quiet,\n+\t\tOPT_BOOL('q', \"quiet\", &quiet,\n \t\t\t N_(\"don't print the patch filenames\")),\n \t\tOPT_END()\n \t};\n-- \n1.8.4.rc0.1.g8f6a3e5\n"},{"id":"224261","messageId":"1375127398-31904-4-git-send-email-stefanbeller@googlemail.com","threadId":"34561","inReplyTo":"1375127398-31904-1-git-send-email-stefanbeller@googlemail.com","subject":"[PATCH 3/4] checkout: remove superfluous local variable","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-29T19:49:57Z","receivedAt":"2013-07-29T19:49:57Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n builtin/checkout.c | 12 +++++-------\n 1 file changed, 5 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 8b48f4a..ed39cec 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -228,8 +228,6 @@ static int checkout_paths(const struct checkout_opts *opts,\n \tint flag;\n \tstruct commit *head;\n \tint errs = 0;\n-\tint stage = opts->writeout_stage;\n-\tint merge = opts->merge;\n \tint newfd;\n \tstruct lock_file *lock_file;\n \n@@ -327,8 +325,8 @@ static int checkout_paths(const struct checkout_opts *opts,\n \t\t\t\tcontinue;\n \t\t\tif (opts->force) {\n \t\t\t\twarning(_(\"path '%s' is unmerged\"), ce->name);\n-\t\t\t} else if (stage) {\n-\t\t\t\terrs |= check_stage(stage, ce, pos);\n+\t\t\t} else if (opts->writeout_stage) {\n+\t\t\t\terrs |= check_stage(opts->writeout_stage, ce, pos);\n \t\t\t} else if (opts->merge) {\n \t\t\t\terrs |= check_stages((1<<2) | (1<<3), ce, pos);\n \t\t\t} else {\n@@ -352,9 +350,9 @@ static int checkout_paths(const struct checkout_opts *opts,\n \t\t\t\terrs |= checkout_entry(ce, &state, NULL);\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tif (stage)\n-\t\t\t\terrs |= checkout_stage(stage, ce, pos, &state);\n-\t\t\telse if (merge)\n+\t\t\tif (opts->writeout_stage)\n+\t\t\t\terrs |= checkout_stage(opts->writeout_stage, ce, pos, &state);\n+\t\t\telse if (opts->merge)\n \t\t\t\terrs |= checkout_merged(pos, &state);\n \t\t\tpos = skip_same_name(ce, pos) - 1;\n \t\t}\n-- \n1.8.4.rc0.1.g8f6a3e5\n"},{"id":"224262","messageId":"1375127398-31904-5-git-send-email-stefanbeller@googlemail.com","threadId":"34561","inReplyTo":"1375127398-31904-1-git-send-email-stefanbeller@googlemail.com","subject":"[PATCH 4/4] name-rev: ease up condition","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-29T19:49:58Z","receivedAt":"2013-07-29T19:49:58Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Now that the internal variables 'all' and 'transform_stdin' are read in\nby OPT_BOOL, which makes sure to have the variable being 0 or 1 after\nreading, we do not need the double negation to map any other value to\n1.\n\nSigned-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n builtin/name-rev.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex a908a34..20fcf8c 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -331,7 +331,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)\n \n \tgit_config(git_default_config, NULL);\n \targc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0);\n-\tif (!!all + !!transform_stdin + !!argc > 1) {\n+\tif (all + transform_stdin + !!argc > 1) {\n \t\terror(\"Specify either a list, or --all, not both!\");\n \t\tusage_with_options(name_rev_usage, opts);\n \t}\n-- \n1.8.4.rc0.1.g8f6a3e5\n"},{"id":"224265","messageId":"51F6E71A.8050109@web.de","threadId":"34561","inReplyTo":"1375127398-31904-3-git-send-email-stefanbeller@googlemail.com","subject":"Re: [PATCH 2/4] log, format-patch: accept short parameter 'q' for quiet","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2013-07-29T22:05:14Z","receivedAt":"2013-07-29T22:05:14Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 29.07.2013 21:49, schrieb Stefan Beller:\n> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>\n> ---\n>   builtin/log.c | 4 ++--\n>   1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/log.c b/builtin/log.c\n> index 9b6c910..5cb968b 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -121,7 +121,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,\n>   \tstatic struct line_opt_callback_data line_cb = {NULL, NULL, STRING_LIST_INIT_DUP};\n>\n>   \tconst struct option builtin_log_options[] = {\n> -\t\tOPT_BOOL(0, \"quiet\", &quiet, N_(\"suppress diff output\")),\n> +\t\tOPT_BOOL('q', \"quiet\", &quiet, N_(\"suppress diff output\")),\n\nYou can shorten it using OPT__QUIET.  But that macro should be converted \nto OPT_BOOL first, in turn.  Unless --verbose, for which it sometimes \nmakes sense to print ever more output the more often it is specified, I \nwouldn't expect there to be a command with different levels of \nquietness, but didn't check.\n\n>   \t\tOPT_BOOL(0, \"source\", &source, N_(\"show source\")),\n>   \t\tOPT_BOOL(0, \"use-mailmap\", &mailmap, N_(\"Use mail map file\")),\n>   \t\t{ OPTION_CALLBACK, 0, \"decorate\", NULL, NULL, N_(\"decorate options\"),\n> @@ -1210,7 +1210,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n>   \t\t\t    PARSE_OPT_OPTARG, thread_callback },\n>   \t\tOPT_STRING(0, \"signature\", &signature, N_(\"signature\"),\n>   \t\t\t    N_(\"add a signature\")),\n> -\t\tOPT_BOOL(0, \"quiet\", &quiet,\n> +\t\tOPT_BOOL('q', \"quiet\", &quiet,\n>   \t\t\t N_(\"don't print the patch filenames\")),\n>   \t\tOPT_END()\n>   \t};\n>\n"},{"id":"224348","messageId":"51F8E85C.9050904@googlemail.com","threadId":"34561","inReplyTo":"51F6E71A.8050109@web.de","subject":"Re: [PATCH 2/4] log, format-patch: accept short parameter 'q' for quiet","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-31T10:35:08Z","receivedAt":"2013-07-31T10:35:08Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 07/30/13 00:05, René Scharfe wrote:\n> Am 29.07.2013 21:49, schrieb Stefan Beller:\n>>       const struct option builtin_log_options[] = {\n>> -        OPT_BOOL(0, \"quiet\", &quiet, N_(\"suppress diff output\")),\n>> +        OPT_BOOL('q', \"quiet\", &quiet, N_(\"suppress diff output\")),\n> \n> You can shorten it using OPT__QUIET.  But that macro should be converted\n> to OPT_BOOL first, in turn.  Unless --verbose, for which it sometimes\n> makes sense to print ever more output the more often it is specified, I\n> wouldn't expect there to be a command with different levels of\n> quietness, but didn't check.\n> \n\nThanks for the hint.\nI'll look into that as well.\n\n"}]}