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

Bug 357313

Summary: Branch deletion from 'Git Repositories' view does not prompt for confirmation
Product: [Technology] EGit Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: kevinsheedy, matthias.sohn
Version: 1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Remy Suen CLA 2011-09-10 16:52:25 EDT
When you use the context menu to delete a branch from the 'Git Repositories' view, it does _not_ prompt you for confirmation and can lead to data loss.

The dialog should warn me if that branch hasn't been merged, similar to the command line requiring the user to use -D to acknowledge that the branch can be deleted irrespective of its merged status.
Comment 1 Remy Suen CLA 2011-09-10 16:56:07 EDT
(In reply to comment #0)
> The dialog should warn me if that branch hasn't been merged, similar to the
> command line requiring the user to use -D to acknowledge that the branch can be
> deleted irrespective of its merged status.

Looking at the code, it does warn me if the branch hasn't been merged yet. So this paragraph can be ignored.
Comment 2 Matthias Sohn CLA 2011-09-13 12:07:41 EDT
Maybe we could add a "Restore branch" action in the reflog view instead of an annoying confirmation dialog.
Comment 3 Matthias Sohn CLA 2011-12-06 19:33:19 EST
I believe the current behavior is adequate. Hence reducing priority.

Can you specify which data can get lost here ? If you don't get a confirmation dialog this means you will not loose any commit (since they all are merged into another existing branch).
Comment 4 Remy Suen CLA 2011-12-06 21:19:13 EST
(In reply to comment #3)
> Can you specify which data can get lost here ? If you don't get a confirmation
> dialog this means you will not loose any commit (since they all are merged into
> another existing branch).

Agreed.
Comment 5 Kevin Sheedy CLA 2012-10-03 12:44:07 EDT
I still think there should be a simple dialog similar to when deleting a tag. I don't think Branch Deletion is a frequent enough task that a simple popup would be much of an annoyance. On the other hand, an accidental branch deletion could be very annoying.

Here's a user story:

1) I make 50 commits on master and think it's quite stable.
2) I create Branch_A off master.
3) I now make 50 more commits to master before I get around to working on Branch_A.
4) I try to checkout Branch_A but accidentally hit delete.

In this case, there's no easy way to retrieve my branch using eGit. I probably should have tagged the stable revision but I thought branching off it would be enough.
Comment 6 Kevin Sheedy CLA 2012-10-03 12:50:17 EDT
Also, newbies often don't understand that git branches are only pointers. If a newbie from an SVN background were to accidentally delete a branch, they would most likely think they had deleted all the revisions too. This would most likely be very distressing and they might not know what to do.