doc: fix some style issues in git-clone and for-each-ref-options
* spell out all forms of --[no-]reject-shallow in git-clone * use imperative mood for the first line of options * Use asciidoc NOTE macro * fix markups Reviewed-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila committed
Feb 6, 2026 at 04:12 UTC
ccaca2c4751b380e0268c061268e3f5cc419fcdb
3 files changed
+30
-30
Documentation/for-each-ref-options.adoc
+2
-2
@@ -30,8 +30,8 @@ TAB %(refname)`.
30
31
`--color[=<when>]`::
32
Respect any colors specified in the `--format` option. The
33
- _<when__ field must be one of `always`, `never`, or `auto` (if
34
- `<when>` is absent, behave as if `always` was given).
33
+ _<when>_ field must be one of `always`, `never`, or `auto` (if
34
+ _<when>_ is absent, behave as if `always` was given).
35
36
`--shell`::
37
`--perl`::
Documentation/git-clone.adoc
+26
-26
@@ -84,7 +84,7 @@ _<src>_.
84
with the source repository. The resulting repository
85
starts out without any object of its own.
86
+
87
-*NOTE*: this is a possibly dangerous operation; do *not* use
87
+NOTE: this is a possibly dangerous operation; do *not* use
88
it unless you understand what it does. If you clone your
89
repository using this option and then delete branches (or use any
90
other Git command that makes any existing commit unreferenced) in the
@@ -104,7 +104,8 @@ If you want to break the dependency of a repository cloned with `--shared` on
104
its source repository, you can simply run `git repack -a` to copy all
105
objects from the source repository into a pack in the cloned repository.
106
107
-`--reference[-if-able] <repository>`::
107
+`--reference=<repository>`::
108
+`--reference-if-able=<repository>`::
109
If the reference _<repository>_ is on the local machine,
110
automatically setup `.git/objects/info/alternates` to
111
obtain objects from the reference _<repository>_. Using
@@ -115,7 +116,7 @@ objects from the source repository into a pack in the cloned repository.
116
directory is skipped with a warning instead of aborting
117
the clone.
118
+
118
-*NOTE*: see the NOTE for the `--shared` option, and also the
119
+NOTE: see the NOTE for the `--shared` option, and also the
120
`--dissociate` option.
121
122
`--dissociate`::
@@ -140,14 +141,14 @@ objects from the source repository into a pack in the cloned repository.
141
to the standard error stream.
142
143
`--progress`::
143
- Progress status is reported on the standard error stream
144
- by default when it is attached to a terminal, unless `--quiet`
144
+ Report progress status on the standard error stream
145
+ by default when attached to a terminal, unless `--quiet`
146
is specified. This flag forces progress status even if the
147
standard error stream is not directed to a terminal.
148
149
`--server-option=<option>`::
150
Transmit the given string to the server when communicating using
150
- protocol version 2. The given string must not contain a NUL or LF
151
+ protocol version 2. The given string must not contain a _NUL_ or _LF_
152
character. The server's handling of server options, including
153
unknown ones, is server-specific.
154
When multiple `--server-option=<option>` are given, they are all
@@ -158,9 +159,10 @@ objects from the source repository into a pack in the cloned repository.
159
160
`-n`::
161
`--no-checkout`::
161
- No checkout of `HEAD` is performed after the clone is complete.
162
+ Do not checkout `HEAD` after the clone is complete.
163
163
-`--`[`no-`]`reject-shallow`::
164
+`--no-reject-shallow`::
165
+`--reject-shallow`::
166
Fail if the source repository is a shallow repository.
167
The `clone.rejectShallow` configuration variable can be used to
168
specify the default.
@@ -206,18 +208,17 @@ objects from the source repository into a pack in the cloned repository.
208
that all these refs are overwritten by a `git remote update` in the
209
target repository.
210
209
-`-o <name>`::
210
-`--origin <name>`::
211
+`-o<name>`::
212
+`--origin=<name>`::
213
Instead of using the remote name `origin` to keep track of the upstream
214
repository, use _<name>_. Overrides `clone.defaultRemoteName` from the
215
config.
216
215
-`-b <name>`::
216
-`--branch <name>`::
217
- Instead of pointing the newly created `HEAD` to the branch pointed
218
- to by the cloned repository's `HEAD`, point to _<name>_ branch
219
- instead. In a non-bare repository, this is the branch that will
220
- be checked out.
217
+`-b<name>`::
218
+`--branch=<name>`::
219
+ Point the newly created `HEAD` to _<name>_ branch instead of the branch
220
+ pointed to by the cloned repository's `HEAD`. In a non-bare repository,
221
+ this is the branch that will be checked out.
222
`--branch` can also take tags and detaches the `HEAD` at that commit
223
in the resulting repository.
224
@@ -230,18 +231,17 @@ objects from the source repository into a pack in the cloned repository.
231
name.
232
This option is incompatible with `--branch` and `--mirror`.
233
233
-`-u <upload-pack>`::
234
-`--upload-pack <upload-pack>`::
235
- When given, and the repository to clone from is accessed
236
- via ssh, this specifies a non-default path for the command
237
- run on the other end.
234
+`-u<upload-pack>`::
235
+`--upload-pack=<upload-pack>`::
236
+ Specify a non-default path for the command run on the other end when the
237
+ repository to clone from is accessed via ssh.
238
239
`--template=<template-directory>`::
240
Specify the directory from which templates will be used;
241
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
242
243
-`-c <key>=<value>`::
244
-`--config <key>=<value>`::
243
+`-c<key>=<value>`::
244
+`--config=<key>=<value>`::
245
Set a configuration variable in the newly-created repository;
246
this takes effect immediately after the repository is
247
initialized, but before the remote history is fetched or any
@@ -257,7 +257,7 @@ Configuration variables known to not take effect are:
257
`remote.<name>.mirror` and `remote.<name>.tagOpt`. Use the
258
corresponding `--mirror` and `--no-tags` options instead.
259
260
-`--depth <depth>`::
260
+`--depth=<depth>`::
261
Create a 'shallow' clone with a history truncated to the
262
specified number of commits. Implies `--single-branch` unless
263
`--no-single-branch` is given to fetch the histories near the
@@ -339,8 +339,8 @@ Specify the given ref storage format for the repository. The valid values are:
339
+
340
include::ref-storage-format.adoc[]
341
342
-`-j <n>`::
343
-`--jobs <n>`::
342
+`-j<n>`::
343
+`--jobs=<n>`::
344
The number of submodules fetched at the same time.
345
Defaults to the `submodule.fetchJobs` option.
346
Documentation/ref-storage-format.adoc
+2
-2
@@ -1,3 +1,3 @@
1
-* `files` for loose files with packed-refs. This is the default.
2
-* `reftable` for the reftable format. This format is experimental and its
1
+`files`;; for loose files with packed-refs. This is the default.
2
+`reftable`;; for the reftable format. This format is experimental and its
3
internals are subject to change.