Skip to content

Commit e703d71

Browse files
committed
parse-options: multi-word argh should use dash to separate words
"When you need to use space, use dash" is a strange way to say that you must not use a space. Because it is more common for the command line descriptions to use dashed-multi-words, you do not even want to use spaces in these places. Rephrase the documentation to avoid this strangeness. Fix a few existing multi-word argument help strings, i.e. - GPG key-ids given to -S/--gpg-sign are "key-id"; - Refs used for storing notes are "notes-ref"; and - Expiry timestamps given to --expire are "expiry-date". and update the corresponding documentation pages. Signed-off-by: Junio C Hamano <[email protected]>
1 parent ce7f874 commit e703d71

File tree

13 files changed

+24
-24
lines changed

13 files changed

+24
-24
lines changed

Documentation/git-cherry-pick.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SYNOPSIS
99
--------
1010
[verse]
1111
'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
12-
[-S[<keyid>]] <commit>...
12+
[-S[<key-id>]] <commit>...
1313
'git cherry-pick' --continue
1414
'git cherry-pick' --quit
1515
'git cherry-pick' --abort
@@ -101,8 +101,8 @@ effect to your index in a row.
101101
--signoff::
102102
Add Signed-off-by line at the end of the commit message.
103103

104-
-S[<keyid>]::
105-
--gpg-sign[=<keyid>]::
104+
-S[<key-id>]::
105+
--gpg-sign[=<key-id>]::
106106
GPG-sign commits.
107107

108108
--ff::

Documentation/git-commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SYNOPSIS
1313
[-F <file> | -m <msg>] [--reset-author] [--allow-empty]
1414
[--allow-empty-message] [--no-verify] [-e] [--author=<author>]
1515
[--date=<date>] [--cleanup=<mode>] [--[no-]status]
16-
[-i | -o] [-S[<keyid>]] [--] [<file>...]
16+
[-i | -o] [-S[<key-id>]] [--] [<file>...]
1717

1818
DESCRIPTION
1919
-----------

Documentation/git-merge.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit]
13-
[-s <strategy>] [-X <strategy-option>] [-S[<keyid>]]
13+
[-s <strategy>] [-X <strategy-option>] [-S[<key-id>]]
1414
[--[no-]rerere-autoupdate] [-m <msg>] [<commit>...]
1515
'git merge' <msg> HEAD <commit>...
1616
'git merge' --abort

Documentation/git-notes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SYNOPSIS
1414
'git notes' append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
1515
'git notes' edit [<object>]
1616
'git notes' show [<object>]
17-
'git notes' merge [-v | -q] [-s <strategy> ] <notes_ref>
17+
'git notes' merge [-v | -q] [-s <strategy> ] <notes-ref>
1818
'git notes' merge --commit [-v | -q]
1919
'git notes' merge --abort [-v | -q]
2020
'git notes' remove [--ignore-missing] [--stdin] [<object>...]

Documentation/git-rev-parse.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,14 @@ The lines after the separator describe the options.
290290
Each line of options has this format:
291291

292292
------------
293-
<opt_spec><flags>*<arg_hint>? SP+ help LF
293+
<opt-spec><flags>*<arg-hint>? SP+ help LF
294294
------------
295295

296-
`<opt_spec>`::
296+
`<opt-spec>`::
297297
its format is the short option character, then the long option name
298298
separated by a comma. Both parts are not required, though at least one
299299
is necessary. `h,help`, `dry-run` and `f` are all three correct
300-
`<opt_spec>`.
300+
`<opt-spec>`.
301301

302302
`<flags>`::
303303
`<flags>` are of `*`, `=`, `?` or `!`.
@@ -313,11 +313,11 @@ Each line of options has this format:
313313

314314
* Use `!` to not make the corresponding negated long option available.
315315

316-
`<arg_hint>`::
317-
`<arg_hint>`, if specified, is used as a name of the argument in the
318-
help output, for options that take arguments. `<arg_hint>` is
319-
terminated by the first whitespace. When you need to use space in the
320-
argument hint use dash instead.
316+
`<arg-hint>`::
317+
`<arg-hint>`, if specified, is used as a name of the argument in the
318+
help output, for options that take arguments. `<arg-hint>` is
319+
terminated by the first whitespace. It is customary to use a
320+
dash to separate words in a multi-word argument hint.
321321

322322
The remainder of the line, after stripping the spaces, is used
323323
as the help associated to the option.

Documentation/git-revert.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-revert - Revert some existing commits
88
SYNOPSIS
99
--------
1010
[verse]
11-
'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...
11+
'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<key-id>]] <commit>...
1212
'git revert' --continue
1313
'git revert' --quit
1414
'git revert' --abort
@@ -80,8 +80,8 @@ more details.
8080
This is useful when reverting more than one commits'
8181
effect to your index in a row.
8282

83-
-S[<keyid>]::
84-
--gpg-sign[=<keyid>]::
83+
-S[<key-id>]::
84+
--gpg-sign[=<key-id>]::
8585
GPG-sign commits.
8686

8787
-s::

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
10951095
OPT_BOOL(0, "detach", &opts.force_detach, N_("detach the HEAD at named commit")),
10961096
OPT_SET_INT('t', "track", &opts.track, N_("set upstream info for new branch"),
10971097
BRANCH_TRACK_EXPLICIT),
1098-
OPT_STRING(0, "orphan", &opts.new_orphan_branch, N_("new branch"), N_("new unparented branch")),
1098+
OPT_STRING(0, "orphan", &opts.new_orphan_branch, N_("new-branch"), N_("new unparented branch")),
10991099
OPT_SET_INT('2', "ours", &opts.writeout_stage, N_("checkout our version for unmerged files"),
11001100
2),
11011101
OPT_SET_INT('3', "theirs", &opts.writeout_stage, N_("checkout their version for unmerged files"),

builtin/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
14721472
OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),
14731473
OPT_STRING(0, "cleanup", &cleanup_arg, N_("default"), N_("how to strip spaces and #comments from message")),
14741474
OPT_BOOL(0, "status", &include_status, N_("include status in commit message template")),
1475-
{ OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key id"),
1475+
{ OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key-id"),
14761476
N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
14771477
/* end commit message options */
14781478

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static struct option builtin_merge_options[] = {
220220
OPT_BOOL(0, "abort", &abort_current_merge,
221221
N_("abort the current in-progress merge")),
222222
OPT_SET_INT(0, "progress", &show_progress, N_("force progress reporting"), 1),
223-
{ OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key id"),
223+
{ OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key-id"),
224224
N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
225225
OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")),
226226
OPT_END()

builtin/notes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
939939
int result;
940940
const char *override_notes_ref = NULL;
941941
struct option options[] = {
942-
OPT_STRING(0, "ref", &override_notes_ref, N_("notes_ref"),
942+
OPT_STRING(0, "ref", &override_notes_ref, N_("notes-ref"),
943943
N_("use notes from <notes_ref>")),
944944
OPT_END()
945945
};

0 commit comments

Comments
 (0)