Skip to contentSkip to conversation

Add git-ls-files -k.

PATCH In review Junio C Hamano 1 participant 1 message Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 Add git-ls-files -k.

When checkout-cache attempts to check out a non-directory where a directory exists on the work tree, or to check out a file under directory D when path D is a non-directory on the work tree, the attempt fails. Before running checkout-cache, the user can run git-ls-files with the -k (killed) option to get a list of such paths. The tagged output format uses "K" to denote them. This is useful for Porcelain layer to be careful when dealing with the recently corrected behaviour of checkout-cache.

---

*** This should be considered a companion patch to the *** checkout-cache fix you merged recently. An extra safety *** net just like git-check-files.

Documentation/git-ls-files.txt | 10 +++-
ls-files.c | 101 ++++++++++++++++++++++++++++++++++-------

2 files changed, 92 insertions(+), 19 deletions(-)
Documentation/git-ls-files.txt +8 -2
@@ -10,8 +10,8 @@
 SYNOPSIS
 --------
 'git-ls-files' [-z] [-t]
-		(--[cached|deleted|others|ignored|stage|unmerged])\*
-		(-[c|d|o|i|s|u])\*
+		(--[cached|deleted|others|ignored|stage|unmerged|killed])\*
+		(-[c|d|o|i|s|u|k])\*
 		[-x <pattern>|--exclude=<pattern>]
 		[-X <file>|--exclude-from=<file>]
 
@@ -45,6 +45,11 @@
 -u|--unmerged::
 	Show unmerged files in the output (forces --stage)
 
+-k|--killed::
+	Show files on the filesystem that need to be removed due
+	to file/directory conflicts for checkout-cache to
+	succeed.
+
 -z::
 	\0 line termination on output
 
@@ -65,6 +70,7 @@
 	H	cached
 	M	unmerged
 	R	removed/deleted
+	K	to be killed
 	?	other
 
 Output
ls-files.c +84 -17

169 lines not on this page · raw message

------------------------------------------------