Re: $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 12, 2014, 23:53 UTC
- Message-ID
- <CACsJy8Aj-_VhiiG9ogoABaGs69TQ+HyEnOVb75UT53W5+YcKVg@mail.gmail.com>
- In-Reply-To
- <CAD03jn4md9YJZ3fFWmvjiO2KSztc-02QpznXO3LJeiZDz8YhrQ@mail.gmail.com>
On Sun, Oct 12, 2014 at 9:58 AM, Dun Peal <dunpealer@gmail.com> wrote:
Show 9 quoted lines
> I have the pattern `*.out` defined in my `core.excludesfile`. > According to the documentation[1], patterns defined in > `$GIT_DIR/info/exclude` take precedence over `core.excludesfile`, so > for one particular project that needs to track some `.out` files, I > created `$GIT_DIR/info/exclude` with just one pattern: `!*.out`. > > Yet for some reason, `git status` still fails to report newly created > `.out` files for that project. Am I misunderstanding the > documentation?
We process in groups, so rules in core.excludesfile are in one group, those in $GIT_DIR/info/exclude in another group. Negative patterns only has effects within their group, so !*out in .../exclude can't revert *.out in core.excludesfile. Probably implementation limitation, not by design..
But even if we flatten them into one group, i'm not sure you can achieve that. The patterns would be
!*.out *.out
"!*.out" has nothing to revert because it's before "*.out".
-- Duy