Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361566 - Warn when deleting shared Git project from workspace
Summary: Warn when deleting shared Git project from workspace
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 361559
Blocks:
  Show dependency tree
 
Reported: 2011-10-20 11:34 EDT by Markus Keller CLA
Modified: 2011-10-20 11:44 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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()