Subject: Re: jgit and ignore

From: "Ferry Huberts (Pelagic)" <[email-masked]>
Date: Wed, 04 Mar 2009 18:50:42 +0100

Robin Rosenberg wrote:
> Shawn writes:
>> Tor Arne Vestbø <[email-masked]> wrote:
>>> To me that means that EGit should focus just as much on integrating with
>>> Eclipse properly as it does on keeping command line porcelain
>>> interoperability.
>> Yup, I agree completely.  I think Robin would too.
> 100% (or close).
> 

Hey guys

I'm currently refactoring the code to accomodate all of your wishes and 
I've already come a long way.

==> The one thing that I still need to do is get to the global 
core.excludefile setting. How can I do that?

How will it work? Read on... :-)

Suppose we have FILE in DIRECTORY and we want to see whether FILE is 
ignored. (FILE can ofcourse also be a DIR)

The way in which ignores will be evaluated is:
1- See if there is a .gitignore file in DIRECTORY. if so, try to match. 
when a match is found: FILE is ignored. if there is no .gitignore file or 
when no match is found: go one directory up (towards the checkout 
root/workdir) and repeat until a match is found or until the .gitignore in 
the checkout root/workdir has been evaluated.
2- use the patterns from .git/info/exclude (if exists) and try to match. 
when a match is found: FILE is ignored.
3- use the patterns from .git/config:core.excludesfile (when set) and try 
to match. when a match is found: FILE is ignored.
4- when .git/config:core.excludesfile was not set, use the patterns from
global:core.excludesfile (when set) and try to match. when a match is 
found: FILE is ignored.
5- try to match against the Eclipse global Team ignores. when a match is 
found: FILE is ignored.
6- FILE is not ignored

hope this flow is what you want :-)

Ferry