git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug Report: Too many untracked files (gitignore)
@ 2016-09-02 23:06 Brian Levinstein
  2016-09-02 23:58 ` Stefan Beller
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Levinstein @ 2016-09-02 23:06 UTC (permalink / raw)
  To: git

The relevant repo is here:
https://github.com/blevinstein/dotfiles

My gitignore file looks like this:
https://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore
It basically ignores all files, except for specifically whitelisted
files. However, when I run "git status" (git version
2.8.0.rc3.226.g39d4020), I see the following untracked files:

#       .bash_history
#       .bash_logout
#       .cache/
#       [private]
#       [private]
#       .profile
#       .viminfo
#       dev/

I can fix this by removing the following line from my gitignore:

!.vim/colors/*
after which all the untracked files disappear. I also tried changing
that line to:

!.vim/colors/twilight256.vim

but it had no effect.

The same effect can be achieved with any directory name starting with a period:

!.tmux/asdf

!.vim/asdf

where .tmux and .vim are real directories. It does not seem to matter
whether the "asdf" subdirectory exists at all.

Brian Levinstein

blevinstein@gmail.com | bpl4ab@virginia.edu
(703) 673-8711
Google | Software Engineer
University of Virginia | MS Commerce 2014
University of Virginia | BS Computer Science 2013
Alpha Tau Omega | Delta Chapter
http://www.linkedin.com/pub/brian-levinstein/14/620/6ba
https://github.com/blevinstein

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug Report: Too many untracked files (gitignore)
  2016-09-02 23:06 Bug Report: Too many untracked files (gitignore) Brian Levinstein
@ 2016-09-02 23:58 ` Stefan Beller
  2016-09-03  0:52   ` Brian Levinstein
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Beller @ 2016-09-02 23:58 UTC (permalink / raw)
  To: Brian Levinstein; +Cc: git@vger.kernel.org

On Fri, Sep 2, 2016 at 4:06 PM, Brian Levinstein <blevinstein@gmail.com> wrote:
> The relevant repo is here:
> https://github.com/blevinstein/dotfiles
>
> My gitignore file looks like this:
> https://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore
> It basically ignores all files, except for specifically whitelisted
> files. However, when I run "git status" (git version
> 2.8.0.rc3.226.g39d4020), I see the following untracked files:
>
> #       .bash_history
> #       .bash_logout
> #       .cache/
> #       [private]
> #       [private]
> #       .profile
> #       .viminfo
> #       dev/

For the specific files to be exclued, I'd recommend starting with a slash, e.g.

    !/.bashrc
    !/.vim/colors/*

If the pattern does not contain a slash /, Git treats it as a shell
glob pattern and checks
for a match against the pathname relative to the location of the
.gitignore file (relative
to the toplevel of the work tree if not from a .gitignore file).

See the notes section of https://git-scm.com/docs/gitignore

So I do not quite see the bug?

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug Report: Too many untracked files (gitignore)
  2016-09-02 23:58 ` Stefan Beller
@ 2016-09-03  0:52   ` Brian Levinstein
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Levinstein @ 2016-09-03  0:52 UTC (permalink / raw)
  To: Stefan Beller; +Cc: git@vger.kernel.org

The patterns in question do contain a slash, although they don't start
with a slash.

I tried changing it to "!/.vim/colors/*" as you recommended, with no
change in behavior. I even tried adding a leading slash to every
pattern in gitignore, with no effect.

Removing the line with "!/.vim/colors/*" still fixes the problem.

Brian Levinstein
blevinstein@gmail.com | bpl4ab@virginia.edu
(703) 673-8711
Google | Software Engineer
University of Virginia | MS Commerce 2014
University of Virginia | BS Computer Science 2013
Alpha Tau Omega | Delta Chapter
http://www.linkedin.com/pub/brian-levinstein/14/620/6ba
https://github.com/blevinstein


On Fri, Sep 2, 2016 at 4:58 PM, Stefan Beller <sbeller@google.com> wrote:
> On Fri, Sep 2, 2016 at 4:06 PM, Brian Levinstein <blevinstein@gmail.com> wrote:
>> The relevant repo is here:
>> https://github.com/blevinstein/dotfiles
>>
>> My gitignore file looks like this:
>> https://github.com/blevinstein/dotfiles/blob/2400ca8642a7b454a2bfc54e8402343d008836aa/.gitignore
>> It basically ignores all files, except for specifically whitelisted
>> files. However, when I run "git status" (git version
>> 2.8.0.rc3.226.g39d4020), I see the following untracked files:
>>
>> #       .bash_history
>> #       .bash_logout
>> #       .cache/
>> #       [private]
>> #       [private]
>> #       .profile
>> #       .viminfo
>> #       dev/
>
> For the specific files to be exclued, I'd recommend starting with a slash, e.g.
>
>     !/.bashrc
>     !/.vim/colors/*
>
> If the pattern does not contain a slash /, Git treats it as a shell
> glob pattern and checks
> for a match against the pathname relative to the location of the
> .gitignore file (relative
> to the toplevel of the work tree if not from a .gitignore file).
>
> See the notes section of https://git-scm.com/docs/gitignore
>
> So I do not quite see the bug?
>
> Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-03  0:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-02 23:06 Bug Report: Too many untracked files (gitignore) Brian Levinstein
2016-09-02 23:58 ` Stefan Beller
2016-09-03  0:52   ` Brian Levinstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).