Skip to content

Commit 2dd7984

Browse files
committed
Merge branch 'jk/maint-docs' into maint
* jk/maint-docs: docs: fix some antique example output docs: make sure literal "->" isn't converted to arrow docs: update status --porcelain format docs: minor grammar fixes to git-status
2 parents 24263cf + 62b42d3 commit 2dd7984

File tree

4 files changed

+35
-15
lines changed

4 files changed

+35
-15
lines changed

Documentation/git-cvsserver.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Configuring database backend
252252

253253
'git-cvsserver' uses the Perl DBI module. Please also read
254254
its documentation if changing these variables, especially
255-
about `DBI->connect()`.
255+
about `DBI\->connect()`.
256256

257257
gitcvs.dbname::
258258
Database name. The exact meaning depends on the

Documentation/git-diff-index.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ show that. So let's say that you have edited `kernel/sched.c`, but
9696
have not actually done a 'git update-index' on it yet - there is no
9797
"object" associated with the new state, and you get:
9898

99-
torvalds@ppc970:~/v2.6/linux> git diff-index HEAD
100-
*100644->100664 blob 7476bb......->000000...... kernel/sched.c
99+
torvalds@ppc970:~/v2.6/linux> git diff-index --abbrev HEAD
100+
:100644 100664 7476bb... 000000... kernel/sched.c
101101

102102
i.e., it shows that the tree has changed, and that `kernel/sched.c` has is
103103
not up-to-date and may contain new stuff. The all-zero sha1 means that to

Documentation/git-diff-tree.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ so it can be used to name subdirectories.
138138

139139
An example of normal usage is:
140140

141-
torvalds@ppc970:~/git> git diff-tree 5319e4......
142-
*100664->100664 blob ac348b.......->a01513....... git-fsck-objects.c
141+
torvalds@ppc970:~/git> git diff-tree --abbrev 5319e4
142+
:100664 100664 ac348b... a01513... git-fsck-objects.c
143143

144144
which tells you that the last commit changed just one file (it's from
145145
this one:

Documentation/git-status.txt

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ OPTIONS
3232
Show the branch and tracking info even in short-format.
3333

3434
--porcelain::
35-
Give the output in a stable, easy-to-parse format for scripts.
36-
Currently this is identical to --short output, but is guaranteed
37-
not to change in the future, making it safe for scripts.
35+
Give the output in an easy-to-parse format for scripts.
36+
This is similar to the short output, but will remain stable
37+
across git versions and regardless of user configuration. See
38+
below for details.
3839

3940
-u[<mode>]::
4041
--untracked-files[=<mode>]::
@@ -78,23 +79,27 @@ OUTPUT
7879
The output from this command is designed to be used as a commit
7980
template comment, and all the output lines are prefixed with '#'.
8081
The default, long format, is designed to be human readable,
81-
verbose and descriptive. They are subject to change in any time.
82+
verbose and descriptive. Its contents and format are subject to change
83+
at any time.
8284

8385
The paths mentioned in the output, unlike many other git commands, are
8486
made relative to the current directory if you are working in a
8587
subdirectory (this is on purpose, to help cutting and pasting). See
8688
the status.relativePaths config option below.
8789

88-
In short-format, the status of each path is shown as
90+
Short Format
91+
~~~~~~~~~~~~
92+
93+
In the short-format, the status of each path is shown as
8994

9095
XY PATH1 -> PATH2
9196

92-
where `PATH1` is the path in the `HEAD`, and ` -> PATH2` part is
97+
where `PATH1` is the path in the `HEAD`, and the ` \-> PATH2` part is
9398
shown only when `PATH1` corresponds to a different path in the
9499
index/worktree (i.e. the file is renamed). The 'XY' is a two-letter
95100
status code.
96101

97-
The fields (including the `->`) are separated from each other by a
102+
The fields (including the `\->`) are separated from each other by a
98103
single space. If a filename contains whitespace or other nonprintable
99104
characters, that field will be quoted in the manner of a C string
100105
literal: surrounded by ASCII double quote (34) characters, and with
@@ -143,10 +148,25 @@ If -b is used the short-format status is preceded by a line
143148

144149
## branchname tracking info
145150

146-
There is an alternate -z format recommended for machine parsing. In
151+
Porcelain Format
152+
~~~~~~~~~~~~~~~~
153+
154+
The porcelain format is similar to the short format, but is guaranteed
155+
not to change in a backwards-incompatible way between git versions or
156+
based on user configuration. This makes it ideal for parsing by scripts.
157+
The description of the short format above also describes the porcelain
158+
format, with a few exceptions:
159+
160+
1. The user's color.status configuration is not respected; color will
161+
always be off.
162+
163+
2. The user's status.relativePaths configuration is not respected; paths
164+
shown will always be relative to the repository root.
165+
166+
There is also an alternate -z format recommended for machine parsing. In
147167
that format, the status field is the same, but some other things
148-
change. First, the '->' is omitted from rename entries and the field
149-
order is reversed (e.g 'from -> to' becomes 'to from'). Second, a NUL
168+
change. First, the '\->' is omitted from rename entries and the field
169+
order is reversed (e.g 'from \-> to' becomes 'to from'). Second, a NUL
150170
(ASCII 0) follows each filename, replacing space as a field separator
151171
and the terminating newline (but a space still separates the status
152172
field from the first filename). Third, filenames containing special

0 commit comments

Comments
 (0)