Skip to content

Commit 20f84c8

Browse files
committed
Merge branch 'rs/opt-help-text'
* rs/opt-help-text: verify-tag: document --verbose branch: improve --verbose description archive: improve --verbose description Describe various forms of "be quiet" using OPT__QUIET add OPT__FORCE add description parameter to OPT__QUIET add description parameter to OPT__DRY_RUN add description parameter to OPT__VERBOSE
2 parents cbcf0a6 + 6e56534 commit 20f84c8

31 files changed

+66
-59
lines changed

Documentation/git-verify-tag.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Validates the gpg signature created by 'git tag'.
1515

1616
OPTIONS
1717
-------
18+
-v::
19+
--verbose::
20+
Print the contents of the tag object before validating it.
21+
1822
<tag>...::
1923
SHA1 identifiers of git tag objects.
2024

Documentation/technical/api-parse-options.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,16 @@ There are some macros to easily define options:
118118
`OPT__COLOR(&int_var, description)`::
119119
Add `\--color[=<when>]` and `--no-color`.
120120

121-
`OPT__DRY_RUN(&int_var)`::
121+
`OPT__DRY_RUN(&int_var, description)`::
122122
Add `-n, \--dry-run`.
123123

124-
`OPT__QUIET(&int_var)`::
124+
`OPT__FORCE(&int_var, description)`::
125+
Add `-f, \--force`.
126+
127+
`OPT__QUIET(&int_var, description)`::
125128
Add `-q, \--quiet`.
126129

127-
`OPT__VERBOSE(&int_var)`::
130+
`OPT__VERBOSE(&int_var, description)`::
128131
Add `-v, \--verbose`.
129132

130133
`OPT_GROUP(description)`::

archive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static int parse_archive_args(int argc, const char **argv,
314314
"write the archive to this file"),
315315
OPT_BOOLEAN(0, "worktree-attributes", &worktree_attributes,
316316
"read .gitattributes in working directory"),
317-
OPT__VERBOSE(&verbose),
317+
OPT__VERBOSE(&verbose, "report archived files on stderr"),
318318
OPT__COMPR('0', &compression_level, "store only", 0),
319319
OPT__COMPR('1', &compression_level, "compress faster", 1),
320320
OPT__COMPR_HIDDEN('2', &compression_level, 2),

builtin/add.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ static int verbose = 0, show_only = 0, ignored_too = 0, refresh_only = 0;
313313
static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;
314314

315315
static struct option builtin_add_options[] = {
316-
OPT__DRY_RUN(&show_only),
317-
OPT__VERBOSE(&verbose),
316+
OPT__DRY_RUN(&show_only, "dry run"),
317+
OPT__VERBOSE(&verbose, "be verbose"),
318318
OPT_GROUP(""),
319319
OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
320320
OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),
321321
OPT_BOOLEAN('e', "edit", &edit_interactive, "edit current diff and apply"),
322-
OPT_BOOLEAN('f', "force", &ignored_too, "allow adding otherwise ignored files"),
322+
OPT__FORCE(&ignored_too, "allow adding otherwise ignored files"),
323323
OPT_BOOLEAN('u', "update", &take_worktree_changes, "update tracked files"),
324324
OPT_BOOLEAN('N', "intent-to-add", &intent_to_add, "record only the fact that the path will be added later"),
325325
OPT_BOOLEAN('A', "all", &addremove, "add all, noticing removal of tracked files"),

builtin/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3849,7 +3849,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
38493849
"don't expect at least one line of context"),
38503850
OPT_BOOLEAN(0, "reject", &apply_with_reject,
38513851
"leave the rejected hunks in corresponding *.rej files"),
3852-
OPT__VERBOSE(&apply_verbosely),
3852+
OPT__VERBOSE(&apply_verbosely, "be verbose"),
38533853
OPT_BIT(0, "inaccurate-eof", &options,
38543854
"tolerate incorrectly detected missing new-line at the end of file",
38553855
INACCURATE_EOF),

builtin/branch.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
621621

622622
struct option options[] = {
623623
OPT_GROUP("Generic options"),
624-
OPT__VERBOSE(&verbose),
624+
OPT__VERBOSE(&verbose,
625+
"show hash and subject, give twice for upstream branch"),
625626
OPT_SET_INT('t', "track", &track, "set up tracking mode (see git-pull(1))",
626627
BRANCH_TRACK_EXPLICIT),
627628
OPT_SET_INT( 0, "set-upstream", &track, "change upstream info",
@@ -651,7 +652,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
651652
OPT_BIT('m', NULL, &rename, "move/rename a branch and its reflog", 1),
652653
OPT_BIT('M', NULL, &rename, "move/rename a branch, even if target exists", 2),
653654
OPT_BOOLEAN('l', NULL, &reflog, "create the branch's reflog"),
654-
OPT_BOOLEAN('f', "force", &force_create, "force creation (when already exists)"),
655+
OPT__FORCE(&force_create, "force creation (when already exists)"),
655656
{
656657
OPTION_CALLBACK, 0, "no-merged", &merge_filter_ref,
657658
"commit", "print only not merged branches",

builtin/checkout-index.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
217217
struct option builtin_checkout_index_options[] = {
218218
OPT_BOOLEAN('a', "all", &all,
219219
"checks out all files in the index"),
220-
OPT_BOOLEAN('f', "force", &force,
221-
"forces overwrite of existing files"),
222-
OPT__QUIET(&quiet),
220+
OPT__FORCE(&force, "forces overwrite of existing files"),
221+
OPT__QUIET(&quiet,
222+
"no warning for existing files and files not in index"),
223223
OPT_BOOLEAN('n', "no-create", &not_new,
224224
"don't checkout new files"),
225225
{ OPTION_CALLBACK, 'u', "index", &newfd, NULL,

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
686686
int patch_mode = 0;
687687
int dwim_new_local_branch = 1;
688688
struct option options[] = {
689-
OPT__QUIET(&opts.quiet),
689+
OPT__QUIET(&opts.quiet, "suppress progress reporting"),
690690
OPT_STRING('b', NULL, &opts.new_branch, "branch",
691691
"create and checkout a new branch"),
692692
OPT_STRING('B', NULL, &opts.new_branch_force, "branch",
@@ -699,7 +699,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
699699
2),
700700
OPT_SET_INT('3', "theirs", &opts.writeout_stage, "checkout their version for unmerged files",
701701
3),
702-
OPT_BOOLEAN('f', "force", &opts.force, "force checkout (throw away local modifications)"),
702+
OPT__FORCE(&opts.force, "force checkout (throw away local modifications)"),
703703
OPT_BOOLEAN('m', "merge", &opts.merge, "perform a 3-way merge with the new branch"),
704704
OPT_STRING(0, "conflict", &conflict_style, "style",
705705
"conflict style (merge or diff3)"),

builtin/clean.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
4848
const char *qname;
4949
char *seen = NULL;
5050
struct option options[] = {
51-
OPT__QUIET(&quiet),
52-
OPT__DRY_RUN(&show_only),
53-
OPT_BOOLEAN('f', "force", &force, "force"),
51+
OPT__QUIET(&quiet, "do not print names of files removed"),
52+
OPT__DRY_RUN(&show_only, "dry run"),
53+
OPT__FORCE(&force, "force"),
5454
OPT_BOOLEAN('d', NULL, &remove_directories,
5555
"remove whole directories"),
5656
{ OPTION_CALLBACK, 'e', "exclude", &exclude_list, "pattern",

builtin/commit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset)
114114
}
115115

116116
static struct option builtin_commit_options[] = {
117-
OPT__QUIET(&quiet),
118-
OPT__VERBOSE(&verbose),
117+
OPT__QUIET(&quiet, "suppress summary after successful commit"),
118+
OPT__VERBOSE(&verbose, "show diff in commit message template"),
119119

120120
OPT_GROUP("Commit message options"),
121121
OPT_FILENAME('F', "file", &logfile, "read log from file"),
@@ -1048,7 +1048,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
10481048
int fd;
10491049
unsigned char sha1[20];
10501050
static struct option builtin_status_options[] = {
1051-
OPT__VERBOSE(&verbose),
1051+
OPT__VERBOSE(&verbose, "be verbose"),
10521052
OPT_SET_INT('s', "short", &status_format,
10531053
"show status concisely", STATUS_FORMAT_SHORT),
10541054
OPT_BOOLEAN('b', "branch", &status_show_branch,

0 commit comments

Comments
 (0)