Skip to content

Commit 208c986

Browse files
committed
Merge branch 'zh/arg-help-format' into next
Clean up option descriptions in "git cmd --help". * zh/arg-help-format: builtin/*: update usage format parse-options: format argh like error messages
2 parents 6f9e11a + e73fe3d commit 208c986

File tree

8 files changed

+64
-64
lines changed

8 files changed

+64
-64
lines changed

builtin/am.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,10 +2284,10 @@ int cmd_am(int argc, const char **argv, const char *prefix)
22842284
N_("skip the current patch"),
22852285
RESUME_SKIP),
22862286
OPT_CMDMODE(0, "abort", &resume.mode,
2287-
N_("restore the original branch and abort the patching operation."),
2287+
N_("restore the original branch and abort the patching operation"),
22882288
RESUME_ABORT),
22892289
OPT_CMDMODE(0, "quit", &resume.mode,
2290-
N_("abort the patching operation but keep HEAD where it is."),
2290+
N_("abort the patching operation but keep HEAD where it is"),
22912291
RESUME_QUIT),
22922292
{ OPTION_CALLBACK, 0, "show-current-patch", &resume.mode,
22932293
"(diff|raw)",

builtin/blame.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -866,33 +866,33 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
866866
const char *revs_file = NULL;
867867
const char *contents_from = NULL;
868868
const struct option options[] = {
869-
OPT_BOOL(0, "incremental", &incremental, N_("Show blame entries as we find them, incrementally")),
870-
OPT_BOOL('b', NULL, &blank_boundary, N_("Do not show object names of boundary commits (Default: off)")),
871-
OPT_BOOL(0, "root", &show_root, N_("Do not treat root commits as boundaries (Default: off)")),
872-
OPT_BOOL(0, "show-stats", &show_stats, N_("Show work cost statistics")),
873-
OPT_BOOL(0, "progress", &show_progress, N_("Force progress reporting")),
874-
OPT_BIT(0, "score-debug", &output_option, N_("Show output score for blame entries"), OUTPUT_SHOW_SCORE),
875-
OPT_BIT('f', "show-name", &output_option, N_("Show original filename (Default: auto)"), OUTPUT_SHOW_NAME),
876-
OPT_BIT('n', "show-number", &output_option, N_("Show original linenumber (Default: off)"), OUTPUT_SHOW_NUMBER),
877-
OPT_BIT('p', "porcelain", &output_option, N_("Show in a format designed for machine consumption"), OUTPUT_PORCELAIN),
878-
OPT_BIT(0, "line-porcelain", &output_option, N_("Show porcelain format with per-line commit information"), OUTPUT_PORCELAIN|OUTPUT_LINE_PORCELAIN),
879-
OPT_BIT('c', NULL, &output_option, N_("Use the same output mode as git-annotate (Default: off)"), OUTPUT_ANNOTATE_COMPAT),
880-
OPT_BIT('t', NULL, &output_option, N_("Show raw timestamp (Default: off)"), OUTPUT_RAW_TIMESTAMP),
881-
OPT_BIT('l', NULL, &output_option, N_("Show long commit SHA1 (Default: off)"), OUTPUT_LONG_OBJECT_NAME),
882-
OPT_BIT('s', NULL, &output_option, N_("Suppress author name and timestamp (Default: off)"), OUTPUT_NO_AUTHOR),
883-
OPT_BIT('e', "show-email", &output_option, N_("Show author email instead of name (Default: off)"), OUTPUT_SHOW_EMAIL),
884-
OPT_BIT('w', NULL, &xdl_opts, N_("Ignore whitespace differences"), XDF_IGNORE_WHITESPACE),
885-
OPT_STRING_LIST(0, "ignore-rev", &ignore_rev_list, N_("rev"), N_("Ignore <rev> when blaming")),
886-
OPT_STRING_LIST(0, "ignore-revs-file", &ignore_revs_file_list, N_("file"), N_("Ignore revisions from <file>")),
869+
OPT_BOOL(0, "incremental", &incremental, N_("show blame entries as we find them, incrementally")),
870+
OPT_BOOL('b', NULL, &blank_boundary, N_("do not show object names of boundary commits (Default: off)")),
871+
OPT_BOOL(0, "root", &show_root, N_("do not treat root commits as boundaries (Default: off)")),
872+
OPT_BOOL(0, "show-stats", &show_stats, N_("show work cost statistics")),
873+
OPT_BOOL(0, "progress", &show_progress, N_("force progress reporting")),
874+
OPT_BIT(0, "score-debug", &output_option, N_("show output score for blame entries"), OUTPUT_SHOW_SCORE),
875+
OPT_BIT('f', "show-name", &output_option, N_("show original filename (Default: auto)"), OUTPUT_SHOW_NAME),
876+
OPT_BIT('n', "show-number", &output_option, N_("show original linenumber (Default: off)"), OUTPUT_SHOW_NUMBER),
877+
OPT_BIT('p', "porcelain", &output_option, N_("show in a format designed for machine consumption"), OUTPUT_PORCELAIN),
878+
OPT_BIT(0, "line-porcelain", &output_option, N_("show porcelain format with per-line commit information"), OUTPUT_PORCELAIN|OUTPUT_LINE_PORCELAIN),
879+
OPT_BIT('c', NULL, &output_option, N_("use the same output mode as git-annotate (Default: off)"), OUTPUT_ANNOTATE_COMPAT),
880+
OPT_BIT('t', NULL, &output_option, N_("show raw timestamp (Default: off)"), OUTPUT_RAW_TIMESTAMP),
881+
OPT_BIT('l', NULL, &output_option, N_("show long commit SHA1 (Default: off)"), OUTPUT_LONG_OBJECT_NAME),
882+
OPT_BIT('s', NULL, &output_option, N_("suppress author name and timestamp (Default: off)"), OUTPUT_NO_AUTHOR),
883+
OPT_BIT('e', "show-email", &output_option, N_("show author email instead of name (Default: off)"), OUTPUT_SHOW_EMAIL),
884+
OPT_BIT('w', NULL, &xdl_opts, N_("ignore whitespace differences"), XDF_IGNORE_WHITESPACE),
885+
OPT_STRING_LIST(0, "ignore-rev", &ignore_rev_list, N_("rev"), N_("ignore <rev> when blaming")),
886+
OPT_STRING_LIST(0, "ignore-revs-file", &ignore_revs_file_list, N_("file"), N_("ignore revisions from <file>")),
887887
OPT_BIT(0, "color-lines", &output_option, N_("color redundant metadata from previous line differently"), OUTPUT_COLOR_LINE),
888888
OPT_BIT(0, "color-by-age", &output_option, N_("color lines by age"), OUTPUT_SHOW_AGE_WITH_COLOR),
889-
OPT_BIT(0, "minimal", &xdl_opts, N_("Spend extra cycles to find better match"), XDF_NEED_MINIMAL),
890-
OPT_STRING('S', NULL, &revs_file, N_("file"), N_("Use revisions from <file> instead of calling git-rev-list")),
891-
OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use <file>'s contents as the final image")),
892-
OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback),
893-
OPT_CALLBACK_F('M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback),
889+
OPT_BIT(0, "minimal", &xdl_opts, N_("spend extra cycles to find better match"), XDF_NEED_MINIMAL),
890+
OPT_STRING('S', NULL, &revs_file, N_("file"), N_("use revisions from <file> instead of calling git-rev-list")),
891+
OPT_STRING(0, "contents", &contents_from, N_("file"), N_("use <file>'s contents as the final image")),
892+
OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback),
893+
OPT_CALLBACK_F('M', NULL, &opt, N_("score"), N_("find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback),
894894
OPT_STRING_LIST('L', NULL, &range_list, N_("range"),
895-
N_("Process only line range <start>,<end> or function :<funcname>")),
895+
N_("process only line range <start>,<end> or function :<funcname>")),
896896
OPT__ABBREV(&abbrev),
897897
OPT_END()
898898
};

builtin/commit-graph.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int graph_verify(int argc, const char **argv)
7878
static struct option builtin_commit_graph_verify_options[] = {
7979
OPT_STRING(0, "object-dir", &opts.obj_dir,
8080
N_("dir"),
81-
N_("The object directory to store the graph")),
81+
N_("the object directory to store the graph")),
8282
OPT_BOOL(0, "shallow", &opts.shallow,
8383
N_("if the commit-graph is split, only verify the tip file")),
8484
OPT_BOOL(0, "progress", &opts.progress, N_("force progress reporting")),
@@ -208,7 +208,7 @@ static int graph_write(int argc, const char **argv)
208208
static struct option builtin_commit_graph_write_options[] = {
209209
OPT_STRING(0, "object-dir", &opts.obj_dir,
210210
N_("dir"),
211-
N_("The object directory to store the graph")),
211+
N_("the object directory to store the graph")),
212212
OPT_BOOL(0, "reachable", &opts.reachable,
213213
N_("start walk at all refs")),
214214
OPT_BOOL(0, "stdin-packs", &opts.stdin_packs,
@@ -314,7 +314,7 @@ int cmd_commit_graph(int argc, const char **argv, const char *prefix)
314314
static struct option builtin_commit_graph_options[] = {
315315
OPT_STRING(0, "object-dir", &opts.obj_dir,
316316
N_("dir"),
317-
N_("The object directory to store the graph")),
317+
N_("the object directory to store the graph")),
318318
OPT_END(),
319319
};
320320

builtin/fast-export.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,32 +1205,32 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
12051205
N_("select handling of commit messages in an alternate encoding"),
12061206
parse_opt_reencode_mode),
12071207
OPT_STRING(0, "export-marks", &export_filename, N_("file"),
1208-
N_("Dump marks to this file")),
1208+
N_("dump marks to this file")),
12091209
OPT_STRING(0, "import-marks", &import_filename, N_("file"),
1210-
N_("Import marks from this file")),
1210+
N_("import marks from this file")),
12111211
OPT_STRING(0, "import-marks-if-exists",
12121212
&import_filename_if_exists,
12131213
N_("file"),
1214-
N_("Import marks from this file if it exists")),
1214+
N_("import marks from this file if it exists")),
12151215
OPT_BOOL(0, "fake-missing-tagger", &fake_missing_tagger,
1216-
N_("Fake a tagger when tags lack one")),
1216+
N_("fake a tagger when tags lack one")),
12171217
OPT_BOOL(0, "full-tree", &full_tree,
1218-
N_("Output full tree for each commit")),
1218+
N_("output full tree for each commit")),
12191219
OPT_BOOL(0, "use-done-feature", &use_done_feature,
1220-
N_("Use the done feature to terminate the stream")),
1221-
OPT_BOOL(0, "no-data", &no_data, N_("Skip output of blob data")),
1220+
N_("use the done feature to terminate the stream")),
1221+
OPT_BOOL(0, "no-data", &no_data, N_("skip output of blob data")),
12221222
OPT_STRING_LIST(0, "refspec", &refspecs_list, N_("refspec"),
1223-
N_("Apply refspec to exported refs")),
1223+
N_("apply refspec to exported refs")),
12241224
OPT_BOOL(0, "anonymize", &anonymize, N_("anonymize output")),
12251225
OPT_CALLBACK_F(0, "anonymize-map", &anonymized_seeds, N_("from:to"),
12261226
N_("convert <from> to <to> in anonymized output"),
12271227
PARSE_OPT_NONEG, parse_opt_anonymize_map),
12281228
OPT_BOOL(0, "reference-excluded-parents",
1229-
&reference_excluded_commits, N_("Reference parents which are not in fast-export stream by object id")),
1229+
&reference_excluded_commits, N_("reference parents which are not in fast-export stream by object id")),
12301230
OPT_BOOL(0, "show-original-ids", &show_original_ids,
1231-
N_("Show original object ids of blobs/commits")),
1231+
N_("show original object ids of blobs/commits")),
12321232
OPT_BOOL(0, "mark-tags", &mark_tags,
1233-
N_("Label tags with mark ids")),
1233+
N_("label tags with mark ids")),
12341234

12351235
OPT_END()
12361236
};

builtin/log.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
177177
const struct option builtin_log_options[] = {
178178
OPT__QUIET(&quiet, N_("suppress diff output")),
179179
OPT_BOOL(0, "source", &source, N_("show source")),
180-
OPT_BOOL(0, "use-mailmap", &mailmap, N_("Use mail map file")),
180+
OPT_BOOL(0, "use-mailmap", &mailmap, N_("use mail map file")),
181181
OPT_ALIAS(0, "mailmap", "use-mailmap"),
182182
OPT_STRING_LIST(0, "decorate-refs", &decorate_refs_include,
183183
N_("pattern"), N_("only decorate refs that match <pattern>")),
@@ -186,7 +186,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
186186
OPT_CALLBACK_F(0, "decorate", NULL, NULL, N_("decorate options"),
187187
PARSE_OPT_OPTARG, decorate_callback),
188188
OPT_CALLBACK('L', NULL, &line_cb, "range:file",
189-
N_("Trace the evolution of line range <start>,<end> or function :<funcname> in <file>"),
189+
N_("trace the evolution of line range <start>,<end> or function :<funcname> in <file>"),
190190
log_line_range_callback),
191191
OPT_END()
192192
};
@@ -1757,13 +1757,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
17571757
OPT_INTEGER(0, "filename-max-length", &fmt_patch_name_max,
17581758
N_("max length of output filename")),
17591759
OPT_CALLBACK_F(0, "rfc", &rev, NULL,
1760-
N_("Use [RFC PATCH] instead of [PATCH]"),
1760+
N_("use [RFC PATCH] instead of [PATCH]"),
17611761
PARSE_OPT_NOARG | PARSE_OPT_NONEG, rfc_callback),
17621762
OPT_STRING(0, "cover-from-description", &cover_from_description_arg,
17631763
N_("cover-from-description-mode"),
17641764
N_("generate parts of a cover letter based on a branch's description")),
17651765
OPT_CALLBACK_F(0, "subject-prefix", &rev, N_("prefix"),
1766-
N_("Use [<prefix>] instead of [PATCH]"),
1766+
N_("use [<prefix>] instead of [PATCH]"),
17671767
PARSE_OPT_NONEG, subject_prefix_callback),
17681768
OPT_CALLBACK_F('o', "output-directory", &output_directory,
17691769
N_("dir"), N_("store resulting files in <dir>"),

builtin/shortlog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,19 +360,19 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
360360

361361
const struct option options[] = {
362362
OPT_BIT('c', "committer", &log.groups,
363-
N_("Group by committer rather than author"),
363+
N_("group by committer rather than author"),
364364
SHORTLOG_GROUP_COMMITTER),
365365
OPT_BOOL('n', "numbered", &log.sort_by_number,
366366
N_("sort output according to the number of commits per author")),
367367
OPT_BOOL('s', "summary", &log.summary,
368-
N_("Suppress commit descriptions, only provides commit count")),
368+
N_("suppress commit descriptions, only provides commit count")),
369369
OPT_BOOL('e', "email", &log.email,
370-
N_("Show the email address of each author")),
370+
N_("show the email address of each author")),
371371
OPT_CALLBACK_F('w', NULL, &log, N_("<w>[,<i1>[,<i2>]]"),
372-
N_("Linewrap output"), PARSE_OPT_OPTARG,
372+
N_("linewrap output"), PARSE_OPT_OPTARG,
373373
&parse_wrap_args),
374374
OPT_CALLBACK(0, "group", &log, N_("field"),
375-
N_("Group by field"), parse_group_option),
375+
N_("group by field"), parse_group_option),
376376
OPT_END(),
377377
};
378378

builtin/submodule--helper.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,9 @@ static int module_foreach(int argc, const char **argv, const char *prefix)
562562
struct module_list list = MODULE_LIST_INIT;
563563

564564
struct option module_foreach_options[] = {
565-
OPT__QUIET(&info.quiet, N_("Suppress output of entering each submodule command")),
565+
OPT__QUIET(&info.quiet, N_("suppress output of entering each submodule command")),
566566
OPT_BOOL(0, "recursive", &info.recursive,
567-
N_("Recurse into nested submodules")),
567+
N_("recurse into nested submodules")),
568568
OPT_END()
569569
};
570570

@@ -706,7 +706,7 @@ static int module_init(int argc, const char **argv, const char *prefix)
706706
int quiet = 0;
707707

708708
struct option module_init_options[] = {
709-
OPT__QUIET(&quiet, N_("Suppress output for initializing a submodule")),
709+
OPT__QUIET(&quiet, N_("suppress output for initializing a submodule")),
710710
OPT_END()
711711
};
712712

@@ -883,8 +883,8 @@ static int module_status(int argc, const char **argv, const char *prefix)
883883
int quiet = 0;
884884

885885
struct option module_status_options[] = {
886-
OPT__QUIET(&quiet, N_("Suppress submodule status output")),
887-
OPT_BIT(0, "cached", &info.flags, N_("Use commit stored in the index instead of the one stored in the submodule HEAD"), OPT_CACHED),
886+
OPT__QUIET(&quiet, N_("suppress submodule status output")),
887+
OPT_BIT(0, "cached", &info.flags, N_("use commit stored in the index instead of the one stored in the submodule HEAD"), OPT_CACHED),
888888
OPT_BIT(0, "recursive", &info.flags, N_("recurse into nested submodules"), OPT_RECURSIVE),
889889
OPT_END()
890890
};
@@ -1482,9 +1482,9 @@ static int module_sync(int argc, const char **argv, const char *prefix)
14821482
int recursive = 0;
14831483

14841484
struct option module_sync_options[] = {
1485-
OPT__QUIET(&quiet, N_("Suppress output of synchronizing submodule url")),
1485+
OPT__QUIET(&quiet, N_("suppress output of synchronizing submodule url")),
14861486
OPT_BOOL(0, "recursive", &recursive,
1487-
N_("Recurse into nested submodules")),
1487+
N_("recurse into nested submodules")),
14881488
OPT_END()
14891489
};
14901490

@@ -1620,9 +1620,9 @@ static int module_deinit(int argc, const char **argv, const char *prefix)
16201620
int all = 0;
16211621

16221622
struct option module_deinit_options[] = {
1623-
OPT__QUIET(&quiet, N_("Suppress submodule status output")),
1624-
OPT__FORCE(&force, N_("Remove submodule working trees even if they contain local changes"), 0),
1625-
OPT_BOOL(0, "all", &all, N_("Unregister all submodules")),
1623+
OPT__QUIET(&quiet, N_("suppress submodule status output")),
1624+
OPT__FORCE(&force, N_("remove submodule working trees even if they contain local changes"), 0),
1625+
OPT_BOOL(0, "all", &all, N_("unregister all submodules")),
16261626
OPT_END()
16271627
};
16281628

@@ -2337,7 +2337,7 @@ static int update_clone(int argc, const char **argv, const char *prefix)
23372337
OPT_BOOL(0, "dissociate", &suc.dissociate,
23382338
N_("use --reference only while cloning")),
23392339
OPT_STRING(0, "depth", &suc.depth, "<depth>",
2340-
N_("Create a shallow clone truncated to the "
2340+
N_("create a shallow clone truncated to the "
23412341
"specified number of revisions")),
23422342
OPT_INTEGER('j', "jobs", &suc.max_jobs,
23432343
N_("parallel jobs")),
@@ -2678,7 +2678,7 @@ static int module_set_url(int argc, const char **argv, const char *prefix)
26782678
char *config_name;
26792679

26802680
struct option options[] = {
2681-
OPT__QUIET(&quiet, N_("Suppress output for setting url of a submodule")),
2681+
OPT__QUIET(&quiet, N_("suppress output for setting url of a submodule")),
26822682
OPT_END()
26832683
};
26842684
const char *const usage[] = {

parse-options.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
8282
* stores pointers to the values to be filled.
8383
*
8484
* `argh`::
85-
* token to explain the kind of argument this option wants. Keep it
86-
* homogeneous across the repository. Should be wrapped by N_() for
87-
* translation.
85+
* token to explain the kind of argument this option wants. Does not
86+
* begin in capital letter, and does not end with a full stop.
87+
* Should be wrapped by N_() for translation.
8888
*
8989
* `help`::
9090
* the short help associated to what the option does.

0 commit comments

Comments
 (0)