git ls files recursively show ignored files
PATCH 1/1 git ls files recursively show ignored files
Make git-ls-files --others --ignored recurse into non-excluded subdirectories.
Typically when asking git-ls-files to display all files which are ignored by one or more exclude patterns one would want it to recurse into subdirectories which are not themselves excluded to see if there are any excluded files contained within those subdirectories.
---
I found this issue while trying to find temporary garbage that was created within a tracked subdirectory:
touch a/b/foo#1 git-ls-files --others --ignored --exclude='*#1'
would never display a/b/foo#1 as the directory 'a' was not itself excluded. It would be rather nice if git-ls-files actually showed it.
ls-files.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
base 98214e96be00c5132047ae80bca20d4690933c33
last 809da5f8a21a10112eece4ee9be55fe64371ce68
ls-files.c +5 -2
@@ -279,8 +279,11 @@ static void read_directory(const char *pcontinue ; len =strlen (de->d_name);memcpy (fullname + baselen, de->d_name, len+1 ); -if (excluded (fullname) != show_ignored) -continue ; +if (excluded (fullname) != show_ignored) { +if (!show_ignored ||DTYPE (de) !=DT_DIR ) { +continue ; + } + }switch (DTYPE (de)) {struct stat st;
Signature · 1 line
1.2.3.g809d