Bug 543783 - "Replace with Head" can unstage
Summary: "Replace with Head" can unstage
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 5.3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-24 06:21 EST by Ed Willink CLA
Modified: 2019-01-30 04:44 EST (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 Ed Willink CLA 2019-01-24 06:21:25 EST
5.3.0 on 4.11M1.

If a file has been staged and then edited, the staging view shows a copy in both unstaged and staged panes; good.

If the unstaged file is "Replace with Head"ed, the staged file is discarded and then the unstaged file is replaced with head.

This discard of a staged file is an unauthorized discard of user input => MAJOR.

A consistent, but not very useful action would be to replace the unstaged with head just as the menu suggests, leaving the staged unaffected.

Much more useful would be, Bug 442146, just/also "Replace with Staged".
Comment 1 Thomas Wolf CLA 2019-01-25 02:08:13 EST
The command even warns the user that changes will be lost. We could maybe improve the wording of that warning. It currently says "will discard all local changes"; we could say "will discard all uncommitted changes".
Comment 2 Eclipse Genie CLA 2019-01-28 03:50:38 EST
New Gerrit change created: https://git.eclipse.org/r/135839
Comment 3 Eclipse Genie CLA 2019-01-30 04:41:54 EST
Gerrit change https://git.eclipse.org/r/135839 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=629f3ef687f0fc5df81c2a7239aac325b0fdc1c5
Comment 4 Thomas Wolf CLA 2019-01-30 04:44:51 EST
Warning text updated as proposed in comment 1. I'm not going to change the behavior of the operation; it does what git checkout HEAD -- <files> does on the command-line.