Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] .gitignored files decoration

the primary cache is the git index :-)

If a file is under an ignored folder in the working tree
- and in the index but not in HEAD it's a new file which has been staged
- and in HEAD but not in the index, then it's deletion was staged
- and neither in the index nor in HEAD then you can assume it's also ignored

All these cases (and a couple more) are handled in IndexDiff.diff() by walking
the trees (working tree, index (called DirCache in jgit) and some version (most often HEAD)).
In order to further improve performance filter the walk to only visit the files you know have
changed based e.g. on file system change events and merge the result of this partial
walk with the result of the previous IndexDiff. This is what EGit does based on resource
change events sent by the Eclipse resource model when files are changed. 

-Matthias

On Tue, Nov 3, 2015 at 12:38 PM, Rozenszajn, Sergio <sergio.rozenszajn@xxxxxxx> wrote:

In the method documentation I can see:

The method returns the list of ignored files and folders. Only the root folder of an ignored folder hierarchy is reported. If a/b/c is listed in the .gitignore then you should not expect a/b/c/d/e/f to be reported here. Only a/b/c will be reported. Furthermore only ignored files / folders are returned that are NOT in the index

 

I would expect that all folders below an .gitignored folder are also ignored (e/f folders with their corresponding files should show up as ignored). If this is not the case we would need to analyze .gitignore file(s) explicitly (with a good caching mechanism)

 

Regards, Sergio

 

From: orion-dev-bounces@xxxxxxxxxxx [mailto:orion-dev-bounces@xxxxxxxxxxx] On Behalf Of Matthias Sohn
Sent:
יום ג 03 נובמבר 2015 11:49
To: Orion developer discussions <orion-dev@xxxxxxxxxxx>
Cc: Epstein, Tomer <tomer.epstein@xxxxxxx>
Subject: Re: [orion-dev] .gitignored files decoration

 

On Tue, Nov 3, 2015 at 7:03 AM, Rozenszajn, Sergio <sergio.rozenszajn@xxxxxxx> wrote:

Hi,

 

In our web IDE client we are requested to provide a decoration for .gitignored files.

I found that it is possible to PUT ignored files in .gitignore using GitServlet.java via GitIgnoreHandlerV1.java.

Unfortunately only PUT is supported and we would need a GET to get all ignored files in a project.

Another thing that I noticed in GitIgnoreHandlerV1 is that if you call it multiple times with same path, it will be added multiple times to .gitignore.

 

Note that native git supports listing ignored files via command git ls-files --others -i --exclude-standard.

 

Questions:

·         is there a way to get all .gitignored files in Orion or it is just missing?

·         If we have to code this by ourselves (we did not decide yet if to code it in client or server)  is possible to list .gitignored files with jgit?

using JGit create an IndexDiff and call getIgnoredNotInIndex()

 

In EGit we cache the IndexDiff and incrementally update it based on events emitted by the resource model in

the Eclipse platform when files in the workspace change in order to improve performance. The EGit staging view

basically displays the cached IndexDiff and is updated incrementally based on incremental IndexDiff updates

which are computed in a resource change event listener.

 

-Matthias


_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/orion-dev


Back to the top