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

[BUG] (minor) "git status ." reports added files as untracked

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Feb 4, 2008, 17:19 UTC
Message-ID
<vpqtzko8ws2.fsf@bauges.imag.fr>
Hi,

I have a minor bug with git (head of master today): Briefly, added files in a toplevel directory show up as "untracked" for "git status ." in a subdirectory. See below to reproduce.

Indeed, I've always considered the fact that "git status ." reports untracked files outside the current directory as a bug, but I'm not sure whether this is intended or not. If not, then not looking for untracked files oustide the directory when doing a limited "status" would be a fix.

No time for a patch, appologize :-(.
/tmp/test$ git init
Initialized empty Git repository in .git/
/tmp/test$ mkdir subdir
/tmp/test$ touch file1
/tmp/test$ git add file1
/tmp/test$ touch subdir/file2
/tmp/test$ cd subdir/
/tmp/test/subdir$ git add file2
/tmp/test/subdir$ git status .
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file: file2
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       ../file1                     <------------------- this one 
                                                          shouldn't be here
/tmp/test/subdir$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file: ../file1
#       new file: file2
#
Regards,

-- Matthieu

Next: Junio C Hamano
Message 1 of 4 in “[BUG] (minor) "git status ." reports added files as untracked”
  1. Matthieu MoyFeb 4, 2008
  2. Junio C HamanoFeb 4, 2008
  3. Matthieu MoyFeb 5, 2008
  4. Eddy PetrișorMar 26, 2008

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.