Community
Participate
Working Groups
Problems occur if a workdir checkout (e.g. done by branch or reset) deletes .project files. Precondition ============ Project p exist in branch b1. .project file of project p is contained in the Git repository. Project p does not exist in branch b2. Active branch is b1. Error ===== Checkout branch b2. This removes the .project file of p. Branch operation fails because refreshing p fails. The workspace now contains a project with missing .project file. Some time later the DelayedSnapshotJob (Workspace AUto-save) restores the .project file. Switching back to branch b1 fails with a checkout conflict: workdir checkout can not be done because there is an untracked .project file in the working directory.
I think the issue could be solved in the following way: if workdir checkout deletes a .project file in the working directory the corresponding project is deleted. This guarantees a consistent workspace.
Fix proposed: http://egit.eclipse.org/r/821
merged as a2ade7f6fdaffc8bf698480d0fe4f341d1248787
i have not enough rights to do so, but i want to reopen this bug. it happens again with current EGit. in the "good case", when "track projects for each branch" is enabled, i "only" get such things (and projects disappear, although they should have stayed (closed) :)): Error Wed Jan 25 14:36:02 CET 2012 File not found: /fast/wamas5/workspaces/runtime-EclipseApplication/wamas5/com.wamas.wms.mobile.voice.shared/build.properties. java.io.FileNotFoundException: /fast/wamas5/workspaces/runtime-EclipseApplication/wamas5/com.wamas.wms.mobile.voice.shared/build.properties (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:137) at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:362) at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797) at org.eclipse.core.internal.resources.File.getContents(File.java:289) at org.eclipse.pde.internal.core.build.WorkspaceBuildModel.load(WorkspaceBuildModel.java:67) at org.eclipse.pde.internal.core.build.BuildModel.getBuild(BuildModel.java:36) at org.eclipse.pde.internal.core.ClasspathUtilCore.getBuild(ClasspathUtilCore.java:195) at org.eclipse.pde.internal.core.PluginModelManager.updateAffectedEntries(PluginModelManager.java:342) at org.eclipse.pde.internal.core.PluginModelManager.modelsChanged(PluginModelManager.java:280) at org.eclipse.pde.internal.core.AbstractModelManager.fireModelProviderEvent(AbstractModelManager.java:35) at org.eclipse.pde.internal.core.WorkspaceModelManager.createAndFireEvent(WorkspaceModelManager.java:263) at org.eclipse.pde.internal.core.WorkspacePluginModelManager.createAndFireEvent(WorkspacePluginModelManager.java:471) at org.eclipse.pde.internal.core.WorkspaceModelManager.processModelChanges(WorkspaceModelManager.java:235) at org.eclipse.pde.internal.core.WorkspaceModelManager.processModelChanges(WorkspaceModelManager.java:197) at org.eclipse.pde.internal.core.WorkspacePluginModelManager.processModelChanges(WorkspacePluginModelManager.java:461) at org.eclipse.pde.internal.core.WorkspaceModelManager.resourceChanged(WorkspaceModelManager.java:118) at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) at org.eclipse.core.internal.events.NotificationManager.handleEvent(NotificationManager.java:249) at org.eclipse.core.internal.resources.Workspace.broadcastEvent(Workspace.java:390) at org.eclipse.core.internal.resources.Project.close(Project.java:199) at org.eclipse.egit.core.internal.util.ProjectUtil.closeMissingProject(ProjectUtil.java:173) at org.eclipse.egit.core.internal.util.ProjectUtil.refreshValidProjects(ProjectUtil.java:142) at org.eclipse.egit.core.op.BranchOperation$1.run(BranchOperation.java:122) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326) at org.eclipse.egit.core.op.BranchOperation.execute(BranchOperation.java:132) at org.eclipse.egit.ui.internal.branch.BranchOperationUI$1.run(BranchOperationUI.java:199) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) in the more bad case i get this: Warning Wed Jan 25 08:21:03 CET 2012 The project description file (.project) for 'com.wamas.wms.mobile.voice.shared' was missing. This file contains important information about the project. A new project description file has been created, but some information about the project may have been lost. and eclipse dumps the file back on disc, which is fatal of course, as it taints the repository. after this happens the only resolution is to close eclipse, manually clean the repo, and restart eclipse. otherwise, the periodic save job will always recreate those files, even though the projects are no longer in the workspace. i don't have an exact reproduction guide, as i'm not reliably able to reproduce here. it seems to depend on the periodic save job somehow...? :S
reopened on Markus' request
Markus: which version are you using here ?
(In reply to comment #6) > Markus: which version are you using here ? happens with builds of most recent master, all nightly's and my self-built ones. maybe a special situation: we have a 400MB git repo with >600 projects, and the re-indexing, updating, etc. takes many many seconds for one go over the repo. It seems like somehow the periodic workspace save job interferes with the refreshing, deleting, and whatever that egit does in this cases. however: i checked the code, and actually i _think_ that at least egit does everything right, because the scheduling rule for the job says to lock the whole workspace. i could not find any reasonable code path that would cause the problem - still it must exist, as the problem is there ... :S
actually, an easy way for me to reproduce this is to run the UI tests for EGit :) last lines in the console output are these i just noticed: !ENTRY org.eclipse.ui.ide 4 4 2012-03-12 15:36:47.668 !MESSAGE Problems saving workspace !ENTRY org.eclipse.ui.ide 2 1 2012-03-12 15:36:47.669 !MESSAGE Problems occurred while trying to save the state of the workbench. !SUBENTRY 1 org.eclipse.core.resources 2 234 2012-03-12 15:36:47.669 !MESSAGE The project description file (.project) for 'EmptyProject' was missing. This file contains important information about the project. A new project description file has been created, but some information about the project may have been lost.
Perhaps the only way is to hook into the resources API and delete resources, including projects that way.