threads / patch / 4443

patchlist_untracked_files: remove empty squashed directories

Subject: [PATCH] list_untracked_files: remove empty squashed directories

## tl;dr

One message between Jun 9, 2006 and Jun 9, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Jeff King· Jun 9, 2006, 05:41 UTC · lore
Signed-off-by: Jeff King <peff@peff.net>
---
This patch is for cogito.

Ordinarily, I would say if you have empty directories, you should remove them. However, if you have a directory in which all files are excluded, it will still appear in cg-status -w (even though cg-status -S is empty!).

This, of course, means that actual empty directories will also be ignored; there's no way around it without putting logic into git-ls-files to distinguish between the two.

 cg-Xlib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to cg-Xlib +1 −1
diff --git a/cg-Xlib b/cg-Xlib
index 839e9f8..3ec32b7 100755
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -443,7 +443,7 @@ list_untracked_files()
 		fi
 	fi
 	local listdirs=
-	[ "$squashflag" != "squashdirs" ] || listdirs=--directory
+	[ "$squashflag" != "squashdirs" ] || listdirs="--directory --no-empty-directory"
 	git-ls-files -z --others $listdirs "${EXCLUDE[@]}"
 }
 
-- 
1.4.0.rc2

← back to recent threads