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

Bug 348144

Summary: [client] git status "undo local changes" suggestions
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Susan McCourt CLA 2011-06-02 17:21:07 EDT
"Undo local changes" sounds like a very recoverable, non-destructive action.  As if I can "undo some changes" and then "redo them" if I need to.  But in fact this is a destructive "throw away all local changes" command. Plus, the big arrow icon doesn't help explain what is going to happen.  

- I think we should use a text command and call it "Reset".  Then we should have a confirmation dialog that explains in more detail what will happen.  

"The content of <RepoName> will be reset to content on <Remote Name>.  All unstaged changes in <RepoName> will be discarded and cannot be recovered.  Are you sure you want to continue?"
Comment 1 Susan McCourt CLA 2011-06-02 17:21:50 EDT
Created attachment 197278 [details]
screenshot
Comment 2 libing wang CLA 2011-06-03 08:27:01 EDT
(In reply to comment #0)
> "Undo local changes" sounds like a very recoverable, non-destructive action. 
> As if I can "undo some changes" and then "redo them" if I need to.  But in fact
> this is a destructive "throw away all local changes" command. Plus, the big
> arrow icon doesn't help explain what is going to happen.  
 Agree.

> - I think we should use a text command and call it "Reset".  Then we should
> have a confirmation dialog that explains in more detail what will happen.  
I have no objections on text command. But there will be two levels of reset.
1. "git reset --hard HEAD" , which is a short cut for checking out everything , unstaged and staged. This is what is currently implemented.

2."git reset --hard HEAD^" , which will blow out the last commit.
Actually when I opened bug 343963 , I intended to use the second one.Because the only way for at the moment was to throw away my last commit to avoid conflict.But when I required server API I miss the "^" part.(bug 347951)

 
> "The content of <RepoName> will be reset to content on <Remote Name>.  All
> unstaged changes in <RepoName> will be discarded and cannot be recovered.  Are
> you sure you want to continue?"
The message here is a little tricky. I think what "git reset --hard HEAD" does is just reset the working directory to the index.Unless we pull , it has nothing to do with the remote.
Comment 3 libing wang CLA 2011-06-03 08:29:10 EDT
(In reply to comment #1)
> Created attachment 197278 [details]
> screenshot

As I mentioned in last comment ,  "git reset --hard HEAD" will remove all the changes , including the staged files.Putting this action in the unstaged zone will be misleading.
Comment 4 libing wang CLA 2011-06-03 14:28:17 EDT
fixed with 6fec9f8d03e9feaf52098b683b82bd998af05207.
We will have another reset action that will be fixed in bug 347951.
We will consolidate the text command name and the confirmation message when it is fixed.
Comment 5 libing wang CLA 2011-06-03 14:31:04 EDT
Forgot the solution description :
I am still using page action but the icon becomes "Reset" text link now.
The confirmation message now is :

The content of the working directory will be reset to content on the index. 
All unstaged and staged changes in the working directory will be discarded and cannot be recovered.
Are you sure you want to continue?

Also , I've noticed that the tool tip for text link is gone , was that intended?