Re: [PATCH 6/9] For each exclude pattern, store information about where it came from
- From
Adam Spiers <git@adamspiers.org>
- Date
- Sep 6, 2012, 17:56 UTC
- Message-ID
- <CAOkDyE-u7yzEDu++iX_zRMU==oUWbR5uM1j50N5XH4SaJkB0Ww@mail.gmail.com>
- In-Reply-To
- <A05E4811A66D499DA6AC932AC49F1E8F@PhilipOakley>
On Sun, Sep 2, 2012 at 11:36 PM, Philip Oakley <philipoakley@iee.org> wrote:
Show 6 quoted lines
> From: "Junio C Hamano" <gitster@pobox.com> > Sent: Sunday, September 02, 2012 8:02 PM >> "Philip Oakley" <philipoakley@iee.org> writes: >>> Is there a way to identify the config core.excludesfile if present? >>> i.e. that it is from that config variable, rather than directory >>> traversal.
Yes, the output of git check-ignore includes the source file, so you can easily see whether the ignore originated from a per-directory exclude or from core.excludesfile. One giveaway is that the former is an absolute path, and the latter are all relative.
>> If the code handles $GIT_DIR/info/exclude then that configuration >> would also be handled the same way, no?
Yes, they are both handled via setup_standard_excludes().
> If I've understood the regular code correctly, the core.excludesfile is > always at one end of the exclude struct so should be easy to check at that > position.
It's already checked in my patch series, and the tests cover this case:
https://github.com/aspiers/git/blob/check-ignore/t/t0007-ignores.sh#L214
Having said that, I forgot to make them check $GIT_DIR/info/exclude. I'll fix that.