Bug 397402 - [stagingView] Warn about potential data loss when dragging partially staged files from staged to unstaged area
Summary: [stagingView] Warn about potential data loss when dragging partially staged f...
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 2.3   Edit
Hardware: PC Linux
: P3 blocker with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-01-03 14:26 EST by Andrey Loskutov CLA
Modified: 2019-04-28 12:01 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2013-01-03 14:26:06 EST
Eclipse EGit 2.3.0.201301031513 with Eclipse 3.8.1.

My mypical workflow before commit:

Review each file in staging area by double clicking and opening compare editor, eventually making some changes in the file.
After review eventually move some unfinished changes back to unstaged area.

The problem: ALL changes made on files in index are lost after moving it (via drag and drop) to the unstaged area. There is no warning dialog, no error, just nothing.

You simply silently lost all changes. Tested and failed with latest available Egit.

This should *never* happen.

I don't know how original git behaves (is there something similar to drag and drop in cli?) and actually don't care as in the UI no data loss without explicit warning dialog should happen.
Comment 1 Robin Rosenberg CLA 2013-01-04 18:51:49 EST
Git gui is perhaphs the equivalent here. If you unstage, the changes are lost.
Comment 2 Robin Stocker CLA 2013-01-28 07:33:36 EST
We could show a warning dialog when unstaging a file that has both unstaged and staged changes.

As that only happens when one has partially staged changes or edited the index directly, it should not happen often and therefore not be overly annoying.

Unfortunately, I don't think there's a way to tell if there is going to be data loss. E.g. when some lines were added and only some of those were staged, unstaging that won't lose any of the lines (it will only lose the information which of these lines were staged).
Comment 3 Andrey Loskutov CLA 2013-01-28 16:34:52 EST
For me it would be ok if there were *any* kind of warning.

BTW I can imagine that the "easiest" way to detect a data loss is to show a dialog with "Show Details" button which would simply open up a diff view local file <-> staged version. I think everything is already there, it just need to be wired together.

User would know if it is safe or not and can confirm/disallow.
Comment 4 Robin Stocker CLA 2014-09-30 10:03:51 EDT
(In reply to Andrey Loskutov from comment #3)
> For me it would be ok if there were *any* kind of warning.

Agreed, adding a confirmation dialog in this case would be a good first step, even without further details.

> BTW I can imagine that the "easiest" way to detect a data loss is to show a
> dialog with "Show Details" button which would simply open up a diff view
> local file <-> staged version.

Yes, I think showing the diff and making it clear what will be replaced by what is the nicest solution.

> I think everything is already there, it just
> need to be wired together.

That's true for many EGit bugs/enhancements :). Contributions welcome.