@matheusbsbs / matheus-bagliano / commits / e92e9cd3c3
Fork 0

Documentation improvements for the description of short format.

Incorporates the detailed explanation from Jeff King in <20100410040959.GA11977@coredump.intra.peff.net> and fixes the bug noted by Junio C Hamano in <7vmxxc1i8g.fsf@alter.siamese.dyndns.org>. Signed-off-by: Eric S. Raymond <esr@thyrsus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Raymond committed Apr 23, 2010 at 13:40 UTC e92e9cd3c388544f4f521736df844b37908c3879
1 file changed +34 -9
Documentation/git-status.txt
+34 -9
@@ -72,21 +72,37 @@ In short-format, the status of each path is shown as
72
73 where `PATH1` is the path in the `HEAD`, and ` -> PATH2` part is
74 shown only when `PATH1` corresponds to a different path in the
75 -index/worktree (i.e. renamed).
76 -
77 -For unmerged entries, `X` shows the status of stage #2 (i.e. ours) and `Y`
78 -shows the status of stage #3 (i.e. theirs).
79 -
80 -For entries that do not have conflicts, `X` shows the status of the index,
81 -and `Y` shows the status of the work tree. For untracked paths, `XY` are
82 -`??`.
75 +index/worktree (i.e. the file is renamed). The 'XY' is a two-letter
76 +status code.
77 +
78 +The fields (including the `->`) are separated from each other by a
79 +single space. If a filename contains whitespace or other nonprintable
80 +characters, that field will be quoted in the manner of a C string
81 +literal: surrounded by ASCII double quote (34) characters, and with
82 +interior special characters backslash-escaped.
83 +
84 +For paths with merge conflicts, `X` and 'Y' show the modification
85 +states of each side of the merge. For paths that do not have merge
86 +conflicts, `X` shows the status of the index, and `Y` shows the status
87 +of the work tree. For untracked paths, `XY` are `??`. Other status
88 +codes can be interpreted as follows:
89 +
90 +* ' ' = unmodified
91 +* 'M' = modified
92 +* 'A' = added
93 +* 'D' = deleted
94 +* 'R' = renamed
95 +* 'C' = copied
96 +* 'U' = updated but unmerged
97 +
98 +Ignored files are not listed.
99
100 X Y Meaning
101 -------------------------------------------------
102 [MD] not updated
103 M [ MD] updated in index
104 A [ MD] added to index
89 - D [ MD] deleted from index
105 + D [ M] deleted from index
106 R [ MD] renamed in index
107 C [ MD] copied in index
108 [MARC] index and work tree matches
@@ -104,6 +120,15 @@ and `Y` shows the status of the work tree. For untracked paths, `XY` are
120 ? ? untracked
121 -------------------------------------------------
122
123 +There is an alternate -z format recommended for machine parsing. In
124 +that format, the status field is the same, but some other things
125 +change. First, the '->' is omitted from rename entries and the field
126 +order is reversed (e.g 'from -> to' becomes 'to from'). Second, a NUL
127 +(ASCII 0) follows each filename, replacing space as a field separator
128 +and the terminating newline (but a space still separates the status
129 +field from the first filename). Third, filenames containing special
130 +characters are not specially formatted; no quoting or
131 +backslash-escaping is performed.
132
133 CONFIGURATION
134 -------------