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

[PATCH] wt-status: Show ignored files in untracked dirs

From
Antoine Pelisse <apelisse@gmail.com>
Date
Dec 26, 2012, 10:16 UTC
Message-ID
<1356516985-31068-1-git-send-email-apelisse@gmail.com>
In-Reply-To
<50DA91AF.1060200@alum.mit.edu>

When looking for ignored files, we do not recurse into untracked directory, and simply consider the directory ignored status. As a consequence, we don't see ignored files in those directories.

Change that behavior by recursing into untracked directories searching for ignored files.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
I jumped in.

This seems to be broken since the creation of the --ignored option to wt-status.

This fixes the issue and breaks none of the existing tests. The behavior seems sane to me, giving something like that:

  ?? .gitignore
  ?? x
  ?? y/foo
  !! x.ignore-me
  !! y/foo.ignore-me

Cheers, Antoine

 wt-status.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wt-status.c b/wt-status.c
index 2a9658b..7c41488 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -516,7 +516,7 @@ static void wt_status_collect_untracked(struct wt_status *s)

 	if (s->show_ignored_files) {
 		dir.nr = 0;
-		dir.flags = DIR_SHOW_IGNORED | DIR_SHOW_OTHER_DIRECTORIES;
+		dir.flags = DIR_SHOW_IGNORED;
 		fill_directory(&dir, s->pathspec);
 		for (i = 0; i < dir.nr; i++) {
 			struct dir_entry *ent = dir.entries[i];
--
1.8.1.rc3.11.g86c3e6e.dirty
Previous: Michael HaggertyNext: Antoine Pelisse
Message 2 of 16 in “Bug in git status”
  1. Michael HaggertyDec 26, 2012
  2. wt-status: Show ignored files in untracked dirsAntoine Pelisse, Dec 26, 2012
  3. wt-status: Show ignored files in untracked dirsAntoine Pelisse, Dec 26, 2012
  4. Junio C HamanoDec 27, 2012
  5. Jeff KingDec 27, 2012
  6. Junio C HamanoDec 27, 2012
  7. Antoine PelisseDec 27, 2012
  8. Jeff KingDec 27, 2012
  9. Antoine PelisseDec 27, 2012
  10. Antoine PelisseDec 28, 2012
  11. Jeff KingDec 29, 2012
  12. 1/2 dir.c: Make git-status --ignored more consistentAntoine Pelisse, Dec 30, 2012
  13. 2/2 git-status: Test --ignored behaviorAntoine Pelisse, Dec 30, 2012
  14. Antoine PelisseDec 30, 2012
  15. Adam SpiersDec 30, 2012
  16. Junio C HamanoDec 30, 2012

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.