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

git status and empty directories

From
MLMatthias Lederhofer <matled@gmx.net>
Date
May 18, 2006, 17:57 UTC
Message-ID
<E1Fgmkh-0000ur-Hn@moooo.ath.cx>

Today I've been working on some source with many empty directories. git-status shows all empty directories under "Untracked files: (use "git add" to add to commit)" but adding is impossible. And if it would be possible to add the directory, because a new file exists in the directory, it still shows up in the same place, indistinguishable from the empty directories.

Things I could think of to solve this:
- hide empty directories if the user does not ask explicitly for them
  with a command line option
- vice versa: add a command line option to hide empty directories
(I'd prefer the first one)

Another category in git-status for empty directories which cannot be added could be interesting too because the comment 'use "git add" to add to commit' is quite misleading.

Perhaps there should also be another option to show files in untracked directories.

Any comments? If a patch would be accepted I'll take a look at writing one. Adding the correct options to git-ls-files seems quite trivial.

Next: Linus Torvalds
Message 1 of 3 in “git status and empty directories”
  1. Matthias LederhoferMay 18, 2006
  2. Linus TorvaldsMay 18, 2006
  3. Matthias LederhoferMay 18, 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.