Skip to content

Commit d93f8f0

Browse files
committed
doc: check for absence of the form --[no-]parameter
For better searchability, this commit adds a check to ensure that parameters expressed in the form of `--[no-]parameter` are not used in the documentation. In the place of such parameters, the documentation should use two separate parameters: `--parameter` and `--no-parameter`. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent 5244414 commit d93f8f0

36 files changed

+161
-78
lines changed

Documentation/blame-options.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ include::line-range-format.adoc[]
7575
iso format is used. For supported values, see the discussion
7676
of the --date option at linkgit:git-log[1].
7777

78-
--[no-]progress::
78+
--progress::
79+
--no-progress::
7980
Progress status is reported on the standard error stream
8081
by default when it is attached to a terminal. This flag
8182
enables progress reporting even if not attached to a

Documentation/diff-options.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ endif::git-format-patch[]
505505
Turn off rename detection, even when the configuration
506506
file gives the default to do so.
507507

508-
`--[no-]rename-empty`::
508+
`--rename-empty`::
509+
`--no-rename-empty`::
509510
Whether to use empty blobs as rename source.
510511

511512
ifndef::git-format-patch[]

Documentation/fetch-options.adoc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
--[no-]all::
1+
--all::
2+
--no-all::
23
Fetch all remotes, except for the ones that has the
34
`remote.<name>.skipFetchAll` configuration variable set.
45
This overrides the configuration variable fetch.all`.
@@ -88,7 +89,8 @@ This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
8889
precedence over the `fetch.output` config option.
8990

9091
ifndef::git-pull[]
91-
--[no-]write-fetch-head::
92+
--write-fetch-head::
93+
--no-write-fetch-head::
9294
Write the list of remote refs fetched in the `FETCH_HEAD`
9395
file directly under `$GIT_DIR`. This is the default.
9496
Passing `--no-write-fetch-head` from the command line tells
@@ -118,13 +120,16 @@ ifndef::git-pull[]
118120
Allow several <repository> and <group> arguments to be
119121
specified. No <refspec>s may be specified.
120122

121-
--[no-]auto-maintenance::
122-
--[no-]auto-gc::
123+
--auto-maintenance::
124+
--no-auto-maintenance::
125+
--auto-gc::
126+
--no-auto-gc::
123127
Run `git maintenance run --auto` at the end to perform automatic
124128
repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
125129
This is enabled by default.
126130

127-
--[no-]write-commit-graph::
131+
--write-commit-graph::
132+
--no-write-commit-graph::
128133
Write a commit-graph after fetching. This overrides the config
129134
setting `fetch.writeCommitGraph`.
130135
endif::git-pull[]

Documentation/git-am.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ OPTIONS
4848
--keep-non-patch::
4949
Pass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
5050

51-
--[no-]keep-cr::
51+
--keep-cr::
52+
--no-keep-cr::
5253
With `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])
5354
with the same option, to prevent it from stripping CR at the end of
5455
lines. `am.keepcr` configuration variable can be used to specify the

Documentation/git-backfill.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ OPTIONS
5757
blobs seen at a given path. The default minimum batch size is
5858
50,000.
5959

60-
`--[no-]sparse`::
60+
`--sparse`::
61+
`--no-sparse`::
6162
Only download objects if they appear at a path that matches the
6263
current sparse-checkout. If the sparse-checkout feature is enabled,
6364
then `--sparse` is assumed and can be disabled with `--no-sparse`.

Documentation/git-cat-file.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ OPTIONS
6262
or to ask for a "blob" with `<object>` being a tag object that
6363
points at it.
6464

65-
--[no-]mailmap::
66-
--[no-]use-mailmap::
65+
--mailmap::
66+
--no-mailmap::
67+
--use-mailmap::
68+
--no-use-mailmap::
6769
Use mailmap file to map author, committer and tagger names
6870
and email addresses to canonical real names and email addresses.
6971
See linkgit:git-shortlog[1].

Documentation/git-check-ref-format.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ a branch.
9898

9999
OPTIONS
100100
-------
101-
--[no-]allow-onelevel::
101+
--allow-onelevel::
102+
--no-allow-onelevel::
102103
Controls whether one-level refnames are accepted (i.e.,
103104
refnames that do not contain multiple `/`-separated
104105
components). The default is `--no-allow-onelevel`.

Documentation/git-clone.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ corresponding `--mirror` and `--no-tags` options instead.
272272
reachable from a specified remote branch or tag. This option
273273
can be specified multiple times.
274274

275-
`--[no-]single-branch`::
275+
`--single-branch`::
276+
`--no-single-branch`::
276277
Clone only the history leading to the tip of a single branch,
277278
either specified by the `--branch` option or the primary
278279
branch remote's `HEAD` points at.
@@ -282,7 +283,8 @@ corresponding `--mirror` and `--no-tags` options instead.
282283
branch when `--single-branch` clone was made, no remote-tracking
283284
branch is created.
284285

285-
`--[no-]tags`::
286+
`--tags`::
287+
`--no-tags`::
286288
Control whether or not tags will be cloned. When `--no-tags` is
287289
given, the option will be become permanent by setting the
288290
`remote.<remote>.tagOpt=--no-tags` configuration. This ensures that
@@ -313,10 +315,12 @@ the clone is finished. This option is ignored if the cloned repository does
313315
not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
314316
or `--mirror` is given)
315317

316-
`--[no-]shallow-submodules`::
318+
`--shallow-submodules`::
319+
`--no-shallow-submodules`::
317320
All submodules which are cloned will be shallow with a depth of 1.
318321

319-
`--[no-]remote-submodules`::
322+
`--remote-submodules`::
323+
`--no-remote-submodules`::
320324
All submodules which are cloned will use the status of the submodule's
321325
remote-tracking branch to update the submodule, rather than the
322326
superproject's recorded SHA-1. Equivalent to passing `--remote` to

Documentation/git-commit-graph.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ OPTIONS
3434
object directory, `git commit-graph ...` will exit with non-zero
3535
status.
3636

37-
--[no-]progress::
37+
--progress::
38+
--no-progress::
3839
Turn progress on/off explicitly. If neither is specified, progress is
3940
shown if standard error is connected to a terminal.
4041

Documentation/git-commit.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ include::signoff-option.adoc[]
212212
each trailer would appear, and other details.
213213

214214
`-n`::
215-
`--[no-]verify`::
215+
`--verify`::
216+
`--no-verify`::
216217
Bypass the `pre-commit` and `commit-msg` hooks.
217218
See also linkgit:githooks[5].
218219

0 commit comments

Comments
 (0)