git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] list_untracked_files: remove empty squashed directories

From
Jeff King <peff@peff.net>
Date
Jun 9, 2006, 05:41 UTC
Message-ID
<20060609054134.GA16026@coredump.intra.peff.net>
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(-)
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
Message 1 of 1 in “list_untracked_files: remove empty squashed directories”
  1. list_untracked_files: remove empty squashed directoriesJeff King, Jun 9, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.