{"thread":{"id":"11870","subject":"[BUG] (minor) \"git status .\" reports added files as untracked","startedAt":"2008-02-04T17:19:09Z","lastAt":"2008-03-26T23:07:57Z","messageCount":4,"participants":["Matthieu Moy","Junio C Hamano","Eddy Petrișor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"67384","messageId":"vpqtzko8ws2.fsf@bauges.imag.fr","threadId":"11870","inReplyTo":null,"subject":"[BUG] (minor) \"git status .\" reports added files as untracked","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-02-04T17:19:09Z","receivedAt":"2008-02-04T17:19:09Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Hi,\n\nI have a minor bug with git (head of master today): Briefly, added\nfiles in a toplevel directory show up as \"untracked\" for \n\"git status .\" in a subdirectory. See below to reproduce.\n\nIndeed, I've always considered the fact that \"git status .\" reports\nuntracked files outside the current directory as a bug, but I'm not\nsure whether this is intended or not. If not, then not looking for\nuntracked files oustide the directory when doing a limited \"status\"\nwould be a fix.\n\nNo time for a patch, appologize :-(.\n\n/tmp/test$ git init\nInitialized empty Git repository in .git/\n/tmp/test$ mkdir subdir\n/tmp/test$ touch file1\n/tmp/test$ git add file1\n/tmp/test$ touch subdir/file2\n/tmp/test$ cd subdir/\n/tmp/test/subdir$ git add file2\n/tmp/test/subdir$ git status .\n# On branch master\n#\n# Initial commit\n#\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       new file: file2\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       ../file1                     <------------------- this one \n                                                          shouldn't be here\n/tmp/test/subdir$ git status\n# On branch master\n#\n# Initial commit\n#\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       new file: ../file1\n#       new file: file2\n#\n\nRegards,\n\n--\nMatthieu\n"},{"id":"67430","messageId":"7v7ihkjtvg.fsf@gitster.siamese.dyndns.org","threadId":"11870","inReplyTo":"vpqtzko8ws2.fsf@bauges.imag.fr","subject":"Re: [BUG] (minor) \"git status .\" reports added files as untracked","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-04T21:26:27Z","receivedAt":"2008-02-04T21:26:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Indeed, I've always considered the fact that \"git status .\" reports\n> untracked files outside the current directory as a bug, but I'm not\n> sure whether this is intended or not.\n\nIt is intended.\n\n\"git status $args\" was designed as \"show me what happens if I\nran 'git commit $args' now\", and because a commit is a whole\ntree operation, \n\nIt is a different matter if the intention matches the\nexpectation you picked up from somewhere on how \"scm status\"\nshould work (it most likely doesn't).  It also is a different\nmatter if it is justifiable to have such a mismatch.\n"},{"id":"67485","messageId":"vpqy7a00wby.fsf@bauges.imag.fr","threadId":"11870","inReplyTo":"7v7ihkjtvg.fsf@gitster.siamese.dyndns.org","subject":"Re: [BUG] (minor) \"git status .\" reports added files as untracked","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-02-05T06:08:17Z","receivedAt":"2008-02-05T06:08:17Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> Indeed, I've always considered the fact that \"git status .\" reports\n>> untracked files outside the current directory as a bug, but I'm not\n>> sure whether this is intended or not.\n>\n> It is intended.\n>\n> \"git status $args\" was designed as \"show me what happens if I\n> ran 'git commit $args' now\", and because a commit is a whole\n> tree operation, \n\nI don't understand the point: \"git commit\" doesn't care about\nuntracked files. So if \"git status\" would really only \"show me what\nhappens if I run git commit now\", it wouldn't show untracked files, at\nall.\n\nShowing untracked files is status is IMHO a good thing, it helps me to\nsee if I forget to \"git add\" something. But if I explicitely ask for a\nlimited commit, I really mean I don't care about what happens outside\nthe directory I'm commiting.\n\n-- \nMatthieu\n"},{"id":"73171","messageId":"loom.20080326T225201-965@post.gmane.org","threadId":"11870","inReplyTo":"7v7ihkjtvg.fsf@gitster.siamese.dyndns.org","subject":"Re: [BUG] (minor) \"git status .\" reports added files as untracked","fromName":"Eddy Petrișor","fromEmail":"eddy.petrisor@gmail.com","sentAt":"2008-03-26T23:07:57Z","receivedAt":"2008-03-26T23:07:57Z","isPatch":false,"sender":{"key":"eddy.petrisor@gmail.com","avatar":"https://gravatar.com/avatar/e13eef6cecbe95604b4667c7bddf5aee2bb4af684c5fdceaf9e2aebfead3e9f5?d=mp&s=160"},"body":"Junio C Hamano <gitster <at> pobox.com> writes:\n\n> \n> Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:\n> \n> > Indeed, I've always considered the fact that \"git status .\" reports\n> > untracked files outside the current directory as a bug, but I'm not\n> > sure whether this is intended or not.\n> \n> It is intended.\n> \n> \"git status $args\" was designed as \"show me what happens if I\n> ran 'git commit $args' now\", and because a commit is a whole\n> tree operation, \n\nI am reopening/continuing this thread since, I also have an issue with this\nbehaviour of git status.\n\nAs I said in my report in the Debian BTS\n(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471313) I do see the point\n(from a user PoV) of such a behavior of \"git status .\" .\n\nOf course, \"git status\" is another matter and is really OK to behave like is\ndoes, but \"git status .\" is only a duplicate of the former with no special\nmeaning, while (I feel) most people would see it really pointless, undesired and\nunexpected to behave like it does now.\n\nI really think \"git status .\" should limit the search below the current dir,\nwhile \"git status\" should keep its current meaning.\n\n> It is a different matter if the intention matches the\n> expectation you picked up from somewhere on how \"scm status\"\n> should work (it most likely doesn't).  It also is a different\n> matter if it is justifiable to have such a mismatch.\n\nI think it is justifiable, and I think is an improvement from a user (interface)\nPoV.\n\nTIA.\n\n[1] btw, git status --blabla shows what seems to be git-commit's help\n"}]}