Skip to content

Commit 2b73f5e

Browse files
committed
doc: convert git-status to synopsis style
Also convert unformatted lists to proper AsciiDoc lists. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent d470451 commit 2b73f5e

File tree

1 file changed

+95
-87
lines changed

1 file changed

+95
-87
lines changed

Documentation/git-status.adoc

Lines changed: 95 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ git-status - Show the working tree status
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git status' [<options>] [--] [<pathspec>...]
11+
[synopsis]
12+
git status [<options>] [--] [<pathspec>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -18,57 +18,57 @@ current HEAD commit, paths that have differences between the working
1818
tree and the index file, and paths in the working tree that are not
1919
tracked by Git (and are not ignored by linkgit:gitignore[5]). The first
2020
are what you _would_ commit by running `git commit`; the second and
21-
third are what you _could_ commit by running 'git add' before running
21+
third are what you _could_ commit by running `git add` before running
2222
`git commit`.
2323

2424
OPTIONS
2525
-------
2626

27-
-s::
28-
--short::
27+
`-s`::
28+
`--short`::
2929
Give the output in the short-format.
3030

31-
-b::
32-
--branch::
31+
`-b`::
32+
`--branch`::
3333
Show the branch and tracking info even in short-format.
3434

35-
--show-stash::
35+
`--show-stash`::
3636
Show the number of entries currently stashed away.
3737

38-
--porcelain[=<version>]::
38+
`--porcelain[=<version>]`::
3939
Give the output in an easy-to-parse format for scripts.
4040
This is similar to the short output, but will remain stable
4141
across Git versions and regardless of user configuration. See
4242
below for details.
4343
+
44-
The version parameter is used to specify the format version.
45-
This is optional and defaults to the original version 'v1' format.
44+
The _<version>_ parameter is used to specify the format version.
45+
This is optional and defaults to the original version `v1` format.
4646

47-
--long::
47+
`--long`::
4848
Give the output in the long-format. This is the default.
4949

50-
-v::
51-
--verbose::
50+
`-v`::
51+
`--verbose`::
5252
In addition to the names of files that have been changed, also
5353
show the textual changes that are staged to be committed
5454
(i.e., like the output of `git diff --cached`). If `-v` is specified
5555
twice, then also show the changes in the working tree that
5656
have not yet been staged (i.e., like the output of `git diff`).
5757

58-
-u[<mode>]::
59-
--untracked-files[=<mode>]::
58+
`-u[<mode>]`::
59+
`--untracked-files[=<mode>]`::
6060
Show untracked files.
6161
+
6262
--
6363
The mode parameter is used to specify the handling of untracked files.
64-
It is optional: it defaults to 'all', and if specified, it must be
64+
It is optional: it defaults to `all`, and if specified, it must be
6565
stuck to the option (e.g. `-uno`, but not `-u no`).
6666

6767
The possible options are:
6868

69-
- 'no' - Show no untracked files.
70-
- 'normal' - Shows untracked files and directories.
71-
- 'all' - Also shows individual files in untracked directories.
69+
`no`:: Show no untracked files.
70+
`normal`:: Show untracked files and directories.
71+
`all`:: Also show individual files in untracked directories.
7272

7373
When `-u` option is not used, untracked files and directories are
7474
shown (i.e. the same as specifying `normal`), to help you avoid
@@ -82,76 +82,78 @@ return more quickly without showing untracked files.
8282
All usual spellings for Boolean value `true` are taken as `normal`
8383
and `false` as `no`.
8484

85-
The default can be changed using the status.showUntrackedFiles
85+
The default can be changed using the `status.showUntrackedFiles`
8686
configuration variable documented in linkgit:git-config[1].
8787
--
8888

89-
--ignore-submodules[=<when>]::
90-
Ignore changes to submodules when looking for changes. <when> can be
91-
either "none", "untracked", "dirty" or "all", which is the default.
92-
Using "none" will consider the submodule modified when it either contains
89+
`--ignore-submodules[=<when>]`::
90+
Ignore changes to submodules when looking for changes. _<when>_ can be
91+
either `none`, `untracked`, `dirty` or `all`, which is the default.
92+
`none`;; will consider the submodule modified when it either contains
9393
untracked or modified files or its HEAD differs from the commit recorded
9494
in the superproject and can be used to override any settings of the
95-
'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When
96-
"untracked" is used submodules are not considered dirty when they only
95+
`ignore` option in linkgit:git-config[1] or linkgit:gitmodules[5].
96+
`untracked`;; submodules are not considered dirty when they only
9797
contain untracked content (but they are still scanned for modified
98-
content). Using "dirty" ignores all changes to the work tree of submodules,
98+
content).
99+
`dirty`;; ignore all changes to the work tree of submodules,
99100
only changes to the commits stored in the superproject are shown (this was
100-
the behavior before 1.7.0). Using "all" hides all changes to submodules
101+
the behavior before 1.7.0).
102+
`all`;; hide all changes to submodules
101103
(and suppresses the output of submodule summaries when the config option
102104
`status.submoduleSummary` is set).
103105

104-
--ignored[=<mode>]::
106+
`--ignored[=<mode>]`::
105107
Show ignored files as well.
106108
+
107109
--
108110
The mode parameter is used to specify the handling of ignored files.
109-
It is optional: it defaults to 'traditional'.
111+
It is optional: it defaults to `traditional`.
110112

111113
The possible options are:
112114

113-
- 'traditional' - Shows ignored files and directories, unless
114-
--untracked-files=all is specified, in which case
115-
individual files in ignored directories are
116-
displayed.
117-
- 'no' - Show no ignored files.
118-
- 'matching' - Shows ignored files and directories matching an
119-
ignore pattern.
120-
121-
When 'matching' mode is specified, paths that explicitly match an
115+
`traditional`:: Show ignored files and directories, unless
116+
`--untracked-files=all` is specified, in which case
117+
individual files in ignored directories are
118+
displayed.
119+
`no`:: Show no ignored files.
120+
`matching`:: Show ignored files and directories matching an
121+
ignore pattern.
122+
+
123+
Paths that explicitly match an
122124
ignored pattern are shown. If a directory matches an ignore pattern,
123125
then it is shown, but not paths contained in the ignored directory. If
124126
a directory does not match an ignore pattern, but all contents are
125127
ignored, then the directory is not shown, but all contents are shown.
126128
--
127129

128-
-z::
129-
Terminate entries with NUL, instead of LF. This implies
130+
`-z`::
131+
Terminate entries with _NUL_, instead of _LF_. This implies
130132
the `--porcelain=v1` output format if no other format is given.
131133

132-
--column[=<options>]::
133-
--no-column::
134+
`--column[=<options>]`::
135+
`--no-column`::
134136
Display untracked files in columns. See configuration variable
135137
`column.status` for option syntax. `--column` and `--no-column`
136-
without options are equivalent to 'always' and 'never'
138+
without options are equivalent to `always` and `never`
137139
respectively.
138140

139-
--ahead-behind::
140-
--no-ahead-behind::
141+
`--ahead-behind`::
142+
`--no-ahead-behind`::
141143
Display or do not display detailed ahead/behind counts for the
142-
branch relative to its upstream branch. Defaults to true.
144+
branch relative to its upstream branch. Defaults to `true`.
143145

144-
--renames::
145-
--no-renames::
146+
`--renames`::
147+
`--no-renames`::
146148
Turn on/off rename detection regardless of user configuration.
147149
See also linkgit:git-diff[1] `--no-renames`.
148150

149-
--find-renames[=<n>]::
151+
`--find-renames[=<n>]`::
150152
Turn on rename detection, optionally setting the similarity
151153
threshold.
152154
See also linkgit:git-diff[1] `--find-renames`.
153155

154-
<pathspec>...::
156+
`<pathspec>...`::
155157
See the 'pathspec' entry in linkgit:gitglossary[7].
156158

157159
OUTPUT
@@ -173,12 +175,12 @@ Short Format
173175
In the short-format, the status of each path is shown as one of these
174176
forms
175177

176-
XY PATH
177-
XY ORIG_PATH -> PATH
178+
<xy> <path>
179+
<xy> <orig-path> -> <path>
178180

179-
where `ORIG_PATH` is where the renamed/copied contents came
180-
from. `ORIG_PATH` is only shown when the entry is renamed or
181-
copied. The `XY` is a two-letter status code.
181+
where _<orig-path>_ is where the renamed/copied contents came
182+
from. _<orig-path>_ is only shown when the entry is renamed or
183+
copied. The _<xy>_ is a two-letter status code `XY`.
182184

183185
The fields (including the `->`) are separated from each other by a
184186
single space. If a filename contains whitespace or other nonprintable
@@ -187,7 +189,7 @@ literal: surrounded by ASCII double quote (34) characters, and with
187189
interior special characters backslash-escaped.
188190

189191
There are three different types of states that are shown using this format, and
190-
each one uses the `XY` syntax differently:
192+
each one uses the _<xy>_ syntax differently:
191193

192194
* When a merge is occurring and the merge was successful, or outside of a merge
193195
situation, `X` shows the status of the index and `Y` shows the status of the
@@ -207,14 +209,14 @@ In the following table, these three classes are shown in separate sections, and
207209
these characters are used for `X` and `Y` fields for the first two sections that
208210
show tracked paths:
209211

210-
* ' ' = unmodified
211-
* 'M' = modified
212-
* 'T' = file type changed (regular file, symbolic link or submodule)
213-
* 'A' = added
214-
* 'D' = deleted
215-
* 'R' = renamed
216-
* 'C' = copied (if config option status.renames is set to "copies")
217-
* 'U' = updated but unmerged
212+
' ':: unmodified
213+
`M`:: modified
214+
`T`:: file type changed (regular file, symbolic link or submodule)
215+
`A`:: added
216+
`D`:: deleted
217+
`R`:: renamed
218+
`C`:: copied (if config option status.renames is set to "copies")
219+
`U`:: updated but unmerged
218220

219221
....
220222
X Y Meaning
@@ -248,19 +250,22 @@ U U unmerged, both modified
248250

249251
Submodules have more state and instead report
250252

251-
* 'M' = the submodule has a different HEAD than recorded in the index
252-
* 'm' = the submodule has modified content
253-
* '?' = the submodule has untracked files
253+
`M`:: the submodule has a different HEAD than recorded in the index
254+
`m`:: the submodule has modified content
255+
`?`:: the submodule has untracked files
254256

255257
This is since modified content or untracked files in a submodule cannot be added
256258
via `git add` in the superproject to prepare a commit.
257259

258-
'm' and '?' are applied recursively. For example if a nested submodule
259-
in a submodule contains an untracked file, this is reported as '?' as well.
260+
`m` and `?` are applied recursively. For example if a nested submodule
261+
in a submodule contains an untracked file, this is reported as `?` as well.
260262

261-
If -b is used the short-format status is preceded by a line
263+
If `-b` is used the short-format status is preceded by a line
262264

263-
## branchname tracking info
265+
[synopsis]
266+
----
267+
## <branchname> <tracking-info>
268+
----
264269

265270
Porcelain Format Version 1
266271
~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -271,16 +276,16 @@ based on user configuration. This makes it ideal for parsing by scripts.
271276
The description of the short format above also describes the porcelain
272277
format, with a few exceptions:
273278

274-
1. The user's color.status configuration is not respected; color will
279+
1. The user's `color.status` configuration is not respected; color will
275280
always be off.
276281

277-
2. The user's status.relativePaths configuration is not respected; paths
282+
2. The user's `status.relativePaths` configuration is not respected; paths
278283
shown will always be relative to the repository root.
279284

280-
There is also an alternate -z format recommended for machine parsing. In
285+
There is also an alternate `-z` format recommended for machine parsing. In
281286
that format, the status field is the same, but some other things
282-
change. First, the '\->' is omitted from rename entries and the field
283-
order is reversed (e.g 'from \-> to' becomes 'to from'). Second, a NUL
287+
change. First, the `->` is omitted from rename entries and the field
288+
order is reversed (e.g `from -> to` becomes `to from`). Second, a _NUL_
284289
(ASCII 0) follows each filename, replacing space as a field separator
285290
and the terminating newline (but a space still separates the status
286291
field from the first filename). Third, filenames containing special
@@ -296,7 +301,7 @@ Version 2 format adds more detailed information about the state of
296301
the worktree and changed items. Version 2 also defines an extensible
297302
set of easy to parse optional headers.
298303

299-
Header lines start with "#" and are added in response to specific
304+
Header lines start with `#` and are added in response to specific
300305
command line arguments. Parsers should ignore headers they
301306
don't recognize.
302307

@@ -336,11 +341,13 @@ line types in any order.
336341

337342
Ordinary changed entries have the following format:
338343

339-
1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
344+
[synopsis]
345+
1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
340346

341347
Renamed or copied entries have the following format:
342348

343-
2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
349+
[synopsis]
350+
2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
344351

345352
....
346353
Field Meaning
@@ -377,7 +384,8 @@ Field Meaning
377384
Unmerged entries have the following format; the first character is
378385
a "u" to distinguish from ordinary changed entries.
379386

380-
u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
387+
[synopsis]
388+
u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
381389

382390
....
383391
Field Meaning
@@ -416,7 +424,7 @@ Pathname Format Notes and -z
416424
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
417425

418426
When the `-z` option is given, pathnames are printed as is and
419-
without any quoting and lines are terminated with a NUL (ASCII 0x00)
427+
without any quoting and lines are terminated with a _NUL_ (ASCII 0x00)
420428
byte.
421429

422430
Without the `-z` option, pathnames with "unusual" characters are
@@ -439,11 +447,11 @@ directory.
439447
If `status.submoduleSummary` is set to a non zero number or true (identical
440448
to -1 or an unlimited number), the submodule summary will be enabled for
441449
the long format and a summary of commits for modified submodules will be
442-
shown (see --summary-limit option of linkgit:git-submodule[1]). Please note
450+
shown (see `--summary-limit` option of linkgit:git-submodule[1]). Please note
443451
that the summary output from the status command will be suppressed for all
444-
submodules when `diff.ignoreSubmodules` is set to 'all' or only for those
452+
submodules when `diff.ignoreSubmodules` is set to `all` or only for those
445453
submodules where `submodule.<name>.ignore=all`. To also view the summary for
446-
ignored submodules you can either use the --ignore-submodules=dirty command
454+
ignored submodules you can either use the `--ignore-submodules=dirty` command
447455
line option or the 'git submodule summary' command, which shows a similar
448456
output but does not honor these settings.
449457
@@ -484,7 +492,7 @@ results, so it could be faster on subsequent runs.
484492
setting this variable to `false` disables the warning message
485493
given when enumerating untracked files takes more than 2
486494
seconds. In a large project, it may take longer and the user
487-
may have already accepted the trade off (e.g. using "-uno" may
495+
may have already accepted the trade off (e.g. using `-uno` may
488496
not be an acceptable option for the user), in which case, there
489497
is no point issuing the warning message, and in such a case,
490498
disabling the warning may be the best.

0 commit comments

Comments
 (0)