* git status and empty directories
@ 2006-05-18 17:57 Matthias Lederhofer
2006-05-18 18:12 ` Linus Torvalds
0 siblings, 1 reply; 3+ messages in thread
From: Matthias Lederhofer @ 2006-05-18 17:57 UTC (permalink / raw)
To: git
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git status and empty directories
2006-05-18 17:57 git status and empty directories Matthias Lederhofer
@ 2006-05-18 18:12 ` Linus Torvalds
2006-05-18 18:29 ` Matthias Lederhofer
0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2006-05-18 18:12 UTC (permalink / raw)
To: Matthias Lederhofer; +Cc: Git Mailing List, Junio C Hamano
On Thu, 18 May 2006, Matthias Lederhofer wrote:
>
> - hide empty directories if the user does not ask explicitly for them
> with a command line option
Like this?
Makes sense to me, although I didn't add the option to disable it.
Linus
---
diff --git a/git-commit.sh b/git-commit.sh
index 6ef1a9d..ed00b5c 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -136,11 +136,11 @@ #'
if test -f "$GIT_DIR/info/exclude"
then
- git-ls-files -z --others --directory \
+ git-ls-files -z --others --directory --no-empty-directory \
--exclude-from="$GIT_DIR/info/exclude" \
--exclude-per-directory=.gitignore
else
- git-ls-files -z --others --directory \
+ git-ls-files -z --others --directory --no-empty-directory \
--exclude-per-directory=.gitignore
fi |
perl -e '$/ = "\0";
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: git status and empty directories
2006-05-18 18:12 ` Linus Torvalds
@ 2006-05-18 18:29 ` Matthias Lederhofer
0 siblings, 0 replies; 3+ messages in thread
From: Matthias Lederhofer @ 2006-05-18 18:29 UTC (permalink / raw)
To: Git Mailing List
> Like this?
This is exactly the patch I'm using at the moment and I don't really
need an option to unhide empty directories. Maybe someone else
complains for some reason but git clean -d -n shows empty directories
too.
An option to show untracked files instead of untracked directories
like
> git-ls-files -z --others --exclude-per-directory=.gitignore
would be interesting to see what would be added instead of doing ls
manually.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-05-18 18:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-18 17:57 git status and empty directories Matthias Lederhofer
2006-05-18 18:12 ` Linus Torvalds
2006-05-18 18:29 ` Matthias Lederhofer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).