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 27, 2012, 03:48 UTC
Message-ID
<20121227034859.GA20817@sigill.intra.peff.net>
In-Reply-To
<7vip7omd8c.fsf@alter.siamese.dyndns.org>
On Wed, Dec 26, 2012 at 06:37:55PM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> Antoine Pelisse <apelisse@gmail.com> writes:
> 
> > When looking for ignored files, we do not recurse into untracked
> > directory, and simply consider the directory ignored status.
> 
> When asked to show ignored ones, instead of listing all ignored
> files in such a directory, we just say "everything in this directory
> is ignored"?
> 
> That sounds like a more desirable behaviour, than listing everything
> there, at least to me, but perhaps I am missing something.

I do not use this feature myself, but I would think that it should respect the same DIR_SHOW_OTHER_DIRECTORIES flag (or a parallel flag) that we already hook into "--untracked={all,normal}".

IOW, given:
  git init
  mkdir untracked ignored
  >untracked/file
  >ignored/file
  echo ignored >.git/info/exclude
I would expect:
  $ git status --short --ignored --untracked=normal
  ?? untracked/
  !! ignored/
  $ git status --short --ignored --untracked=all
  ?? untracked/file
  !! ignored/file

I do not know if anybody cares about the distinction, but optionally we could give --ignored its own selector, like:

  $ git status --short --ignored=all --untracked=normal
  ?? untracked/
  !! ignored/file

where obviously it would default to "none" (whereas untracked defaults to "normal"). But the behavior with Antoine's patch is:

  $ git status --short --ignored --untracked=normal
  ?? untracked/
  !! ignored
  $ git status --short --ignored --untracked=all
  ?? untracked/file
  !! ignored
which seems wrong to me for two reasons:
  1. It does not recurse for ignored but untracked entries. Neither does
     the current code, but I think it should.
  2. It loses the trailing slash from the ignored directory in both
     cases (which is printed by the current code).
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 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.