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

Bug 355279

Summary: 'Add to Git Index' context menu item in 'Git Staging' view is initially disabled
Product: [Technology] EGit Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Kevin Sawicki <kevin>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert, stevemash
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Remy Suen CLA 2011-08-19 18:40:55 EDT
If I have no selection and then I choose to right-click on an item in the table for unstaged changes, the 'Add to Git Index' menu item is disabled. Bringing up the menu a second time will make it enabled. However, unselecting all the items again and then bringing up the context menu will show that menu item as being disabled again.
Comment 1 Kevin Sawicki CLA 2011-11-08 20:14:46 EST
Proposed fix pushed to: http://egit.eclipse.org/r/#change,4576
Comment 2 Stefan Lay CLA 2011-11-09 04:54:33 EST
I submitted the change, although I could not reproduce the bug. 

Is it fixed now?
Comment 3 Kevin Sawicki CLA 2011-11-11 17:42:40 EST
Merged as commit 43a17bb770a403e0b8f27c10f07156cd28e754a4
Comment 4 Dani Megert CLA 2011-11-15 10:36:07 EST
(In reply to comment #2)
> I submitted the change, although I could not reproduce the bug. 
> 
> Is it fixed now?

I'm not sure. I think when this happened to me it was with files that I deleted. Now, the menu is there but it does nothing.

1. delete a file (say 'x')
2. in the 'Git Staging' view: select 'x' > context menu > Remove from Git Index
3. in the 'Git Staging' view: select 'x' > context menu > Add to Git Index
==> nothing happens
Comment 5 Kevin Sawicki CLA 2011-11-15 11:55:42 EST
(In reply to comment #4)
> (In reply to comment #2)
> > I submitted the change, although I could not reproduce the bug.
> >
> > Is it fixed now?
> 
> I'm not sure. I think when this happened to me it was with files that I deleted.
> Now, the menu is there but it does nothing.
> 
> 1. delete a file (say 'x')
> 2. in the 'Git Staging' view: select 'x' > context menu > Remove from Git Index
> 3. in the 'Git Staging' view: select 'x' > context menu > Add to Git Index
> ==> nothing happens

I can reproduce this issue, Add to Git Index runs the equivalent of a `git add` command.

The fix for this bug was to correct the initial enablement of the context menu actions.
Comment 6 Dani Megert CLA 2011-11-16 02:47:25 EST
> The fix for this bug was to correct the initial enablement of the context menu
> actions.

Yes, I agree. Verified in 1.2.0.201111150513.


> > Now, the menu is there but it does nothing.
> > 
> > 1. delete a file (say 'x')
> > 2. in the 'Git Staging' view: select 'x' > context menu > Remove from Git Index
> > 3. in the 'Git Staging' view: select 'x' > context menu > Add to Git Index
> > ==> nothing happens
> 
> I can reproduce this issue, Add to Git Index runs the equivalent of a `git add`
> command.

With "reproduce" you mean, you see the same happening but 'git add' does the same and hence it's OK?
Comment 7 Kevin Sawicki CLA 2011-11-16 11:16:20 EST
> With "reproduce" you mean, you see the same happening but 'git add' does the same and hence it's OK?

No, I think this is a bug in the staging view.  It appears you can only stage deletes by dragging and dropping and not
by running the context menu actions.

I think the user expectation is that the 'Add to Git Index' index should work with added, edited, and deleted files.
It currently does not since it only uses the add command and not the rm command.
Comment 8 Dani Megert CLA 2011-11-17 07:06:38 EST
(In reply to comment #7)
> > With "reproduce" you mean, you see the same happening but 'git add' does the same and hence it's OK?
> 
> No, I think this is a bug in the staging view.  It appears you can only stage
> deletes by dragging and dropping and not
> by running the context menu actions.
> 
> I think the user expectation is that the 'Add to Git Index' index should work
> with added, edited, and deleted files.
> It currently does not since it only uses the add command and not the rm
> command.

Filed bug 364018 to track that.
Comment 9 Kevin Sawicki CLA 2011-12-19 13:27:01 EST
*** Bug 367112 has been marked as a duplicate of this bug. ***