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

Bug 361566

Summary: Warn when deleting shared Git project from workspace
Product: [Technology] EGit Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: remy.suen
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 361559    
Bug Blocks:    

Description Markus Keller CLA 2011-10-20 11:34:29 EDT
When a user wants to remove a Git project from the workspace, he must be careful not to delete the project contents (otherwise, the next commit would delete the project from the repository).

This is easy to miss, since the workflow is completely different from usual workflow with other SCMs (CVS, etc.).

The "Delete Project" dialog should show a warning if the user tries to delete contents on disk. You can implement this by contributing to the org.eclipse.ltk.core.refactoring.deleteParticipants extension point. The participant just has to check whether a Git project is to be deleted and return a warning if the contents are also to be deleted.

Unfortunately, DeleteArguments is missing an API to find out whether contents will be deleted (bug 361559). I can add that for 3.8, but for compatibility with Eclipse 3.6, your DeleteParticipant has to access an internal class like this:

    ((DeleteResourcesProcessor) getProcessor()).isDeleteContents()