Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 387604

Summary: Project Resource Filters leads egit to think files are deleted (when they are not)
Product: [Technology] EGit Reporter: Michael Vorburger <mike>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, matthias.sohn, robin.rosenberg
Version: 2.0   
Target Milestone: 3.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Vorburger CLA 2012-08-20 09:10:54 EDT
Something is fishy in relation to Project Resource Filters...

Here are reproducible step-by-steps illustrating what I mean:

# Fresh new workspace, using Juno
# perspective GitHub Repository Exploring
# Clone a Git repo, https://github.com/mfriedenhagen/multi-module-sample.git (master)
     DON'T LET THE GIT WIZARD DO THE PROJECT IMPORT FOR YOU YET, USE THE MAVEN IMPORT
# File > Import > Existing Maven projects, point to directory you cloned into above
# Mark all four projects, and Team > Share Project > Git, use existing.

M2E creates four projects, and the project created for the root directory pom.xml (e.g. multi-module-sample) also shows all the sub-directories (app1/app2/core) - which is ugly/confusing & bad for perf (as there are already Eclipse projects app1/app2/core).

So you do a Project > Properties > Resource > Resource Filters, Add..., Filter type: Exclude all, Applies to: Folders, Name matches "*". Nice - you can still see and edit e.g. the pom.xml in the root multi-module-sample project (but not see the "contained" directories anymore - for which there are "real" Eclipse projects, which hide the built files etc.)

Only... now funny things start happening with eGit - open the Git Staging view, and it suddenly thinks you've removed e.g. the app1/pom.xml (and other files from the excluded directories).
Comment 1 Matthias Sohn CLA 2012-08-20 10:23:35 EDT
EGit doesn't try to handle nested projects properly since Eclipse doesn't really support nested projects. See [1] and [2].

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=329910#c2
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=295645
Comment 2 Michael Vorburger CLA 2012-08-20 10:34:15 EDT
Mathias - thank you for quick response / I see... / voted for that bug.
Comment 3 Robin Rosenberg CLA 2013-05-03 20:13:57 EDT
This should have been solved with 9702515c9e39320e66d5bcc3459826a9babd54d6 (2.3) and 0fa1895d31bcbee85e626c578d14b9b17324dd45 (3.0)