threads / discuss / 30160

Status shows untracked directory without any untracked file in it

Subject: Status shows untracked directory without any untracked file in it

## tl;dr

5 messages between Apr 6, 2012 and Apr 6, 2012.

replies: 4people: 3as markdown or json

Alexander Kostikov· Apr 6, 2012, 05:19 UTC · lore
How that is possible? Is it a bug?

alexko@ALEXKO-LAB b:\ » git status --untracked-files=normal # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # data/fex/lba/hi/qna/ nothing added to commit but untracked files present (use "git add" to track)

alexko@ALEXKO-LAB b:\ » git status --untracked-files=all # On branch master nothing to commit (working directory clean)

-- Alexander Kostikov

Jeff King· Apr 6, 2012, 06:14 UTC · re: Alexander Kostikov · lore

Re: Status shows untracked directory without any untracked file in it

On Thu, Apr 05, 2012 at 10:19:00PM -0700, Alexander Kostikov wrote:
> How that is possible? Is it a bug?

Maybe. What git version and what platform are you on? There was a bug in versions of git earlier than v1.7.8 that showed the symptom you describe on case-insensitive filesystems. It was fixed by commit 2548183, which contains more details.

-Peff
Johannes Sixt· Apr 6, 2012, 18:58 UTC · re: Alexander Kostikov · lore

Re: Status shows untracked directory without any untracked file in it

Am 06.04.2012 07:19, schrieb Alexander Kostikov:
> How that is possible? Is it a bug?

I don't think so. git status normally does not look inside directories that do not contain any tracked files.

Show 8 quoted lines
> alexko@ALEXKO-LAB b:\
> » git status --untracked-files=normal
> # On branch master
> # Untracked files:
> #   (use "git add<file>..." to include in what will be committed)
> #
> #       data/fex/lba/hi/qna/
> nothing added to commit but untracked files present (use "git add" to track)

Here, git status only knows that it does not track anything inside .../qna/, and it tells you that it found this directory.

> alexko@ALEXKO-LAB b:\
> » git status --untracked-files=all
> # On branch master
> nothing to commit (working directory clean)

Here, you ask to list files in all directories, but, alas, the directory does not contain anything untracked. The directory itself is not listed, because git would be unable to track an empty directory.

-- Hannes
Jeff King· Apr 6, 2012, 21:59 UTC · re: Johannes Sixt · lore

Re: Status shows untracked directory without any untracked file in it

On Fri, Apr 06, 2012 at 08:58:03PM +0200, Johannes Sixt wrote:
Show 5 quoted lines
> Am 06.04.2012 07:19, schrieb Alexander Kostikov:
> >How that is possible? Is it a bug?
> 
> I don't think so. git status normally does not look inside
> directories that do not contain any tracked files.
I think it does:
  $ git init tmp && cd tmp
  $ echo content >tracked
  $ git add tracked
  $ mkdir untracked
  $ git status --untracked-files=normal
  # On branch master
  #
  # Initial commit
  #
  # Changes to be committed:
  #       new file:   tracked
  #
  $ >untracked/file
  $ git status --untracked-files=normal
  # On branch master
  #
  # Initial commit
  #
  # Changes to be committed:
  #       new file:   tracked
  #
  # Untracked files:
  #       untracked/
-Peff
Jeff King· Apr 6, 2012, 22:04 UTC · lore

Re: Status shows untracked directory without any untracked file in it

[Please keep replies on the list, so others can benefit from the
 discussion. And please don't top-post.]
On Fri, Apr 06, 2012 at 09:30:20AM -0700, Alexander Kostikov wrote:
Show 8 quoted lines
> Windows. 1.7.9.msysgit.0
> 
> On Thu, Apr 5, 2012 at 11:14 PM, Jeff King <peff@peff.net> wrote:
> >
> > Maybe. What git version and what platform are you on? There was a bug in
> > versions of git earlier than v1.7.8 that showed the symptom you describe
> > on case-insensitive filesystems. It was fixed by commit 2548183, which
> > contains more details.

Your version should have the fix, so it may be a new issue. Is it easily reproducible? Can you share a short reproduction recipe, or possibly share the repo showing the problem?

-Peff

← back to recent threads