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

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

From
Jeff King <peff@peff.net>
Date
Dec 29, 2012, 07:22 UTC
Message-ID
<20121229072249.GB15408@sigill.intra.peff.net>
In-Reply-To
<CALWbr2yNR=K3MqBVe=sfSxPaJ+-A8utHBqoiHPHPLxr_9e9SVQ@mail.gmail.com>
On Fri, Dec 28, 2012 at 03:05:30PM +0100, Antoine Pelisse wrote:
Show 17 quoted lines
> Using the example from Michael's mail, I end up having this:
> $ git status --porcelain --ignored
> ?? .gitignore
> ?? x
> ?? y/
> !! x.ignore-me
> !! y/
> 
> y/ is referred as untracked, because it contains untracked files, and
> then as ignored because it
> contains ignored files.
> 
> Showing it twice doesn't feel right though, so I guess we should only
> show "?? y/" with untracked=normal,
> and "!! y/foo.ignore-me" when using untracked=all
> 
> What do you think ?

Good catch. I agree that showing just "?? y/" in the untracked=normal case makes sense. It makes the definition of "!!" to mean "all untracked files in this path are ignored". IOW, showing "??" means there are one or more untracked, unignored files. There may _also_ be ignored files, but we do not say (nor we even necessarily need to bother checking).

In retrospect, I think it might have made more sense to use the second character of an untracked line to represent "ignored". That is, the output:

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

would make sense to me. But that would be a backwards-incompatible change at this point, and I don't think it's worth it.

-Peff
Previous: Antoine PelisseNext: Antoine Pelisse
Message 11 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.