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

4 messages from 2008-02-04 to 2008-03-26. Participants: Matthieu Moy, Junio C Hamano, Eddy Petrișor.
Thread: https://gitlist.dev/t/11870

## Matthieu Moy, 2008-02-04 17:19

Subject: [BUG] (minor) "git status ." reports added files as untracked
Message-ID: <vpqtzko8ws2.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqtzko8ws2.fsf%40bauges.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

```

## Junio C Hamano, 2008-02-04 21:26

Subject: Re: [BUG] (minor) "git status ." reports added files as untracked
Message-ID: <7v7ihkjtvg.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7ihkjtvg.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <vpqtzko8ws2.fsf@bauges.imag.fr>

```
Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> 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.

It is intended.

"git status $args" was designed as "show me what happens if I
ran 'git commit $args' now", and because a commit is a whole
tree operation, 

It is a different matter if the intention matches the
expectation you picked up from somewhere on how "scm status"
should work (it most likely doesn't).  It also is a different
matter if it is justifiable to have such a mismatch.

```

## Matthieu Moy, 2008-02-05 06:08

Subject: Re: [BUG] (minor) "git status ." reports added files as untracked
Message-ID: <vpqy7a00wby.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqy7a00wby.fsf%40bauges.imag.fr
In-Reply-To: <7v7ihkjtvg.fsf@gitster.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> 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.
>
> It is intended.
>
> "git status $args" was designed as "show me what happens if I
> ran 'git commit $args' now", and because a commit is a whole
> tree operation, 

I don't understand the point: "git commit" doesn't care about
untracked files. So if "git status" would really only "show me what
happens if I run git commit now", it wouldn't show untracked files, at
all.

Showing untracked files is status is IMHO a good thing, it helps me to
see if I forget to "git add" something. But if I explicitely ask for a
limited commit, I really mean I don't care about what happens outside
the directory I'm commiting.

-- 
Matthieu

```

## Eddy Petrișor, 2008-03-26 23:07

Subject: Re: [BUG] (minor) "git status ." reports added files as untracked
Message-ID: <loom.20080326T225201-965@post.gmane.org>
URL: https://gitlist.dev/e/loom.20080326T225201-965%40post.gmane.org
In-Reply-To: <7v7ihkjtvg.fsf@gitster.siamese.dyndns.org>

```
Junio C Hamano <gitster <at> pobox.com> writes:

> 
> Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:
> 
> > 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.
> 
> It is intended.
> 
> "git status $args" was designed as "show me what happens if I
> ran 'git commit $args' now", and because a commit is a whole
> tree operation, 

I am reopening/continuing this thread since, I also have an issue with this
behaviour of git status.

As I said in my report in the Debian BTS
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471313) I do see the point
(from a user PoV) of such a behavior of "git status ." .

Of course, "git status" is another matter and is really OK to behave like is
does, but "git status ." is only a duplicate of the former with no special
meaning, while (I feel) most people would see it really pointless, undesired and
unexpected to behave like it does now.

I really think "git status ." should limit the search below the current dir,
while "git status" should keep its current meaning.

> It is a different matter if the intention matches the
> expectation you picked up from somewhere on how "scm status"
> should work (it most likely doesn't).  It also is a different
> matter if it is justifiable to have such a mismatch.

I think it is justifiable, and I think is an improvement from a user (interface)
PoV.

TIA.

[1] btw, git status --blabla shows what seems to be git-commit's help

```
