Community
Participate
Working Groups
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.
Git gui is perhaphs the equivalent here. If you unstage, the changes are lost.
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).
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.
(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.