Skip to content

Commit 4173b80

Browse files
newrengitster
authored andcommitted
ls-files: clarify descriptions of status tags for -t
Much like the file selection options we tweaked in the last commit, the status tags printed with -t had descriptions that were easy to misunderstand, and for many of the same reasons. Clarify them. Also, while at it, remove the "semi-deprecated" comment for "git ls-files -t". The -t option was marked as semi-deprecated in 5bc0e24 ("Document ls-files -t as semi-obsolete.", 2010-07-28) because:     "git ls-files -t" is [...] badly documented, hence we point the     users to superior alternatives.     The feature is marked as "semi-obsolete" but not "scheduled for removal"     since it's a plumbing command, scripts might use it, and Git testsuite     already uses it to test the state of the index. Marking it as obsolete because it was easily misunderstood, which I think was primarily due to documentation problems, is one strategy, but I think fixing the documentation is a better option. Especially since in the intervening time, "git ls-files -t" has become heavily used by sparse-checkout users where the same confusion just doesn't apply. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2b02d2d commit 4173b80

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Documentation/git-ls-files.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,27 @@ OPTIONS
137137
with `-s` or `-u` options does not make any sense.
138138

139139
-t::
140-
This feature is semi-deprecated. For scripting purpose,
141-
linkgit:git-status[1] `--porcelain` and
140+
Show status tags together with filenames. Note that for
141+
scripting purposes, linkgit:git-status[1] `--porcelain` and
142142
linkgit:git-diff-files[1] `--name-status` are almost always
143143
superior alternatives, and users should look at
144144
linkgit:git-status[1] `--short` or linkgit:git-diff[1]
145145
`--name-status` for more user-friendly alternatives.
146146
+
147147
--
148-
This option identifies the file status with the following tags (followed by
149-
a space) at the start of each line:
150-
151-
H:: cached
152-
S:: skip-worktree
153-
M:: unmerged
154-
R:: removed/deleted
155-
C:: modified/changed
156-
K:: to be killed
157-
?:: other
158-
U:: resolve-undo
148+
This option provides a reason for showing each filename, in the form
149+
of a status tag (which is followed by a space and then the filename).
150+
The status tags are all single characters from the following list:
151+
152+
H:: tracked file that is not either unmerged or skip-worktree
153+
S:: tracked file that is skip-worktree
154+
M:: tracked file that is unmerged
155+
R:: tracked file with unstaged removal/deletion
156+
C:: tracked file with unstaged modification/change
157+
K:: untracked paths which are part of file/directory conflicts
158+
which prevent checking out tracked files
159+
?:: untracked file
160+
U:: file with resolve-undo information
159161
--
160162

161163
-v::

0 commit comments

Comments
 (0)