{"thread":{"id":"43988","subject":"Bug Report: Too many untracked files (gitignore)","startedAt":"2016-09-02T23:06:53Z","lastAt":"2016-09-03T00:53:00Z","messageCount":3,"participants":["Brian Levinstein","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"300922","messageId":"CAMbP-nS_MM0QXgw183DLQPx1YU1BH8ytKCv86p-JSxzdb2jpQA@mail.gmail.com","threadId":"43988","inReplyTo":null,"subject":"Bug Report: Too many untracked files (gitignore)","fromName":"Brian Levinstein","fromEmail":"blevinstein@gmail.com","sentAt":"2016-09-02T23:06:26Z","receivedAt":"2016-09-02T23:06:53Z","isPatch":false,"sender":{"key":"blevinstein@gmail.com","avatar":null},"body":"The relevant repo is here:\nhttps://github.com/blevinstein/dotfiles\n\nMy gitignore file looks like this:\nhttps://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore\nIt basically ignores all files, except for specifically whitelisted\nfiles. However, when I run \"git status\" (git version\n2.8.0.rc3.226.g39d4020), I see the following untracked files:\n\n#       .bash_history\n#       .bash_logout\n#       .cache/\n#       [private]\n#       [private]\n#       .profile\n#       .viminfo\n#       dev/\n\nI can fix this by removing the following line from my gitignore:\n\n!.vim/colors/*\nafter which all the untracked files disappear. I also tried changing\nthat line to:\n\n!.vim/colors/twilight256.vim\n\nbut it had no effect.\n\nThe same effect can be achieved with any directory name starting with a period:\n\n!.tmux/asdf\n\n!.vim/asdf\n\nwhere .tmux and .vim are real directories. It does not seem to matter\nwhether the \"asdf\" subdirectory exists at all.\n\nBrian Levinstein\n\nblevinstein@gmail.com | bpl4ab@virginia.edu\n(703) 673-8711\nGoogle | Software Engineer\nUniversity of Virginia | MS Commerce 2014\nUniversity of Virginia | BS Computer Science 2013\nAlpha Tau Omega | Delta Chapter\nhttp://www.linkedin.com/pub/brian-levinstein/14/620/6ba\nhttps://github.com/blevinstein\n"},{"id":"300927","messageId":"CAGZ79kYhV30AuXUKtp3oewMpnEk5vD=HvRUJTTFaEdsacu3tGw@mail.gmail.com","threadId":"43988","inReplyTo":"CAMbP-nS_MM0QXgw183DLQPx1YU1BH8ytKCv86p-JSxzdb2jpQA@mail.gmail.com","subject":"Re: Bug Report: Too many untracked files (gitignore)","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-09-02T23:58:14Z","receivedAt":"2016-09-02T23:58:20Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Sep 2, 2016 at 4:06 PM, Brian Levinstein <blevinstein@gmail.com> wrote:\n> The relevant repo is here:\n> https://github.com/blevinstein/dotfiles\n>\n> My gitignore file looks like this:\n> https://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore\n> It basically ignores all files, except for specifically whitelisted\n> files. However, when I run \"git status\" (git version\n> 2.8.0.rc3.226.g39d4020), I see the following untracked files:\n>\n> #       .bash_history\n> #       .bash_logout\n> #       .cache/\n> #       [private]\n> #       [private]\n> #       .profile\n> #       .viminfo\n> #       dev/\n\nFor the specific files to be exclued, I'd recommend starting with a slash, e.g.\n\n    !/.bashrc\n    !/.vim/colors/*\n\nIf the pattern does not contain a slash /, Git treats it as a shell\nglob pattern and checks\nfor a match against the pathname relative to the location of the\n.gitignore file (relative\nto the toplevel of the work tree if not from a .gitignore file).\n\nSee the notes section of https://git-scm.com/docs/gitignore\n\nSo I do not quite see the bug?\n\nStefan\n"},{"id":"300929","messageId":"CAMbP-nR9fE0FBaFof6ajMbDFViKwpi4iX3mD0i6cReFveOB2zw@mail.gmail.com","threadId":"43988","inReplyTo":"CAGZ79kYhV30AuXUKtp3oewMpnEk5vD=HvRUJTTFaEdsacu3tGw@mail.gmail.com","subject":"Re: Bug Report: Too many untracked files (gitignore)","fromName":"Brian Levinstein","fromEmail":"blevinstein@gmail.com","sentAt":"2016-09-03T00:52:33Z","receivedAt":"2016-09-03T00:53:00Z","isPatch":false,"sender":{"key":"blevinstein@gmail.com","avatar":null},"body":"The patterns in question do contain a slash, although they don't start\nwith a slash.\n\nI tried changing it to \"!/.vim/colors/*\" as you recommended, with no\nchange in behavior. I even tried adding a leading slash to every\npattern in gitignore, with no effect.\n\nRemoving the line with \"!/.vim/colors/*\" still fixes the problem.\n\nBrian Levinstein\nblevinstein@gmail.com | bpl4ab@virginia.edu\n(703) 673-8711\nGoogle | Software Engineer\nUniversity of Virginia | MS Commerce 2014\nUniversity of Virginia | BS Computer Science 2013\nAlpha Tau Omega | Delta Chapter\nhttp://www.linkedin.com/pub/brian-levinstein/14/620/6ba\nhttps://github.com/blevinstein\n\n\nOn Fri, Sep 2, 2016 at 4:58 PM, Stefan Beller <sbeller@google.com> wrote:\n> On Fri, Sep 2, 2016 at 4:06 PM, Brian Levinstein <blevinstein@gmail.com> wrote:\n>> The relevant repo is here:\n>> https://github.com/blevinstein/dotfiles\n>>\n>> My gitignore file looks like this:\n>> https://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore\n>> It basically ignores all files, except for specifically whitelisted\n>> files. However, when I run \"git status\" (git version\n>> 2.8.0.rc3.226.g39d4020), I see the following untracked files:\n>>\n>> #       .bash_history\n>> #       .bash_logout\n>> #       .cache/\n>> #       [private]\n>> #       [private]\n>> #       .profile\n>> #       .viminfo\n>> #       dev/\n>\n> For the specific files to be exclued, I'd recommend starting with a slash, e.g.\n>\n>     !/.bashrc\n>     !/.vim/colors/*\n>\n> If the pattern does not contain a slash /, Git treats it as a shell\n> glob pattern and checks\n> for a match against the pathname relative to the location of the\n> .gitignore file (relative\n> to the toplevel of the work tree if not from a .gitignore file).\n>\n> See the notes section of https://git-scm.com/docs/gitignore\n>\n> So I do not quite see the bug?\n>\n> Stefan\n"}]}