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

Bug in git status

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Dec 26, 2012, 05:57 UTC
Message-ID
<50DA91AF.1060200@alum.mit.edu>

I think I have found a bug in "git status --untracked-files=all --ignored", in both 1.8.0 and in master:

$ git init status-test Initialized empty Git repository in /home/mhagger/self/proj/git/status-test/.git/ $ cd status-test $ touch x $ touch x.ignore-me $ mkdir y $ touch y/foo $ touch y/foo.ignore-me $ git status --porcelain --untracked-files=all --ignored ?? x ?? x.ignore-me ?? y/foo ?? y/foo.ignore-me

The above output is what I expect. But if I add a .gitignore file, the output of y/foo.ignore-me is incorrectly suppressed:

$ echo '*.ignore-me' >.gitignore $ git status --porcelain --untracked-files=all --ignored ?? .gitignore ?? x ?? y/foo !! x.ignore-me

I came across this problem when trying to use the results of the above command to build a more flexible "git clean" type of script.

I don't have time to look into this at the moment, if somebody wants to jump in.

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Next: Antoine Pelisse
Message 1 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.