Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 12, 2010, 20:40 UTC
- Message-ID
- <20100812204051.GF2029@burratino>
- In-Reply-To
- <AANLkTikDvcn4eFDdkv26ADzsipwD_ofkdYwu_0abeLA3@mail.gmail.com>
Greg Brockman wrote:
Show 8 quoted lines
> For example, in my personal usage, when I ignore a directory but track > some files within it, this is because I don't want to specify an > ignore for every single other file in that directory. Also note that > negated .gitignore entries don't seem to work in this case, i.e. a > .gitignore with contents > dir > !dir/file > won't actually let file be addable again.
Aside: yeah, this is something I have run into before. The workaround I used was to use a dir/.gitignore instead, like this:
* !/file
which is ugly.
Maybe git should get internal support for something like
dir/**
(meaning “all files under dir”) and “!dir/file” could be internally munged to
!/dir dir/** !dir/file
when it appears after “dir”.