DESCRIPTION

Add a 'Staging' view to streamline the workflow of staging changes

Git's staging area is one of its most powerful features. This view
provides users with the ability to drag-and-drop files between
nodes to place modified or untracked files into the staging area.
Such an operation would be synonymous to adding the modified files
to the index and tracking the untracked files. Other operations
like committing is also possible from the view's context menu.

Change-Id: I5fb81a1811cf6f2aff22016438c664fc5014b9a5


COMMENTS

author: Jaylon Avila
date: 2010-05-18 00:01:42.000000000

Patch Set 1: No score

Dragging projects/folders to the other nodes won't work. I was trying to implement this at one point but the logic was getting kind of crazy...or I was approaching the problem incorrectly. Anyway, that's definitely something that needs to be implemented at some point.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-18 09:01:53.000000000

Patch Set 1: No score

I play a little with this feature and first thing that I've notice was that, I can't unstage file after it is staged. I've try to drag it into 'Modified' section but it won't even move.

IMHO there should be also buttons for staging and unstaging so that we user can use 'Staging' with drag and drop action.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-18 09:03:49.000000000

Patch Set 1:

s/with/with out/ ;)

-------------------------------------
author: Jaylon Avila
date: 2010-05-18 09:28:32.000000000

Patch Set 1:

Whoops. Forgot to mention that that's not implemented. Can you do that in regular EGit? I don't think so.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-18 09:31:46.000000000

Patch Set 1:

IFAIK yes, we can call 'Reset to..' -> 'HEAD' in CGit this we can done by 'git reset HEAD /path/'.

-------------------------------------
author: Jaylon Avila
date: 2010-05-18 09:45:58.000000000

Patch Set 1:

I'm guessing you meant a mixed reset to correct the index? In EGit this seems to be an all or nothing operation though whereas you can send in paths for C Git.

-------------------------------------
author: Leslie Stephenson
date: 2010-05-18 10:09:42.000000000

Patch Set 1:

In deed it looks that in [EJ]Git we can't done reset for a single file, but only for a project. This should be changed IMHO.
I didn't look on EGit 'reset to' implementation but maybe we can extract some part form it and implement 'reset to' for a single file in 'Stage' view.

-------------------------------------
author: Jaylon Avila
date: 2010-05-18 10:16:08.000000000

Patch Set 1:

Agreed. Right now the view pretty much exposes nothing more than what you already see [in EGit]. Besides the fact that removed files show up, it does not provide any additional actions at all since everything you see in the context menu is the same as if you right-clicked on a file or a project in another view. :)

A separate change set should be created for allowing the resetting of individual files and then this view will get it for free in the context menu...though some extra code will be needed for the DND case. ;)

-------------------------------------
author: Leslie Stephenson
date: 2010-05-18 10:28:22.000000000

Patch Set 1:

IMHO this change with unstaging files should be included in this patch set ...

Another thing that I'm not really happy of is that we are getting next view (we have already 'Git Repositories', in nearest feature we would have 'Syncrhonize view'). It seams that if user want to use Git integration in Eclipse he should have opened two or tree additional tabs. This could be quite anoing.

I'm wondering if we can merge both view (I mean this one and 'Synchronization') ...

-------------------------------------
author: Jaylon Avila
date: 2010-05-18 10:46:33.000000000

Patch Set 1:

Well, for the unstaging feature, I'll likely submit the change set to Gerrit separately and wait until that gets merged before I integrate that code into this code base (adding the extra DND hook).

As to the 'Synchronize' view, as I mentioned on bug 309582, I do not feel that the 'Synchronize' view is the right place to expose the staging area but if you all think so that's fine by me. Sadly, it seems only Stefan has been chiming in on the discussions. :/

At any rate, I'm not the one that's using Git on a regular basis, I use CVS at work. :) I just want to compare files easily in a view without having to bring up the commit dialog and then double-clicking on those entries individually. ;) I don't really mind where this feature comes from as long as it's accessible from a view.

As an aside, we are really late in the endgame already here in my opinion. Since this change is pretty big, I don't see this feature going into 0.8 so there should be plenty of time to bounce ideas around.

-------------------------------------
author: Jaylon Avila
date: 2010-05-18 12:03:50.000000000

Patch Set 1:

For the record, the unstaging feature request is covered by bug 309362.

-------------------------------------
author: Douglas Trujillo
date: 2010-05-18 23:58:34.000000000

Patch Set 1: I would prefer that you didn't submit this; No score

this is great stuff !

- the analysis should respect ignored resources (same as in package explorer, when Charley's implementation is ready we can replace it with proper gitignore handling), currently it's also analysing e.g. derived files under bin folder which takes quite a while for large repositories
- when I opened the staging view the first time a progress dialog came up having no "send to background" button. Since I had some really large repositories open it took a long time to get this dialog finished.

CQ for this change (to be prepared when review is passed) : https://dev.eclipse.org/ipzilla/show_bug.cgi?id=4125

Please add the following tags to the commit message for this change:
CQ: 4125
Bug: 313263

-------------------------------------
author: Jaylon Avila
date: 2010-05-19 00:16:14.000000000

Patch Set 1:

Matthias, I work for IBM, a member company, is a CQ still required? I thought I saw some SAP code slip by after Chris/Gunnar gave the PMC approval? :O

As for the "derived" problem, my IResourceVisitor _is_ checking via Team.isIgnoredHint(IResource) so I'm not quite sure what's going on here. I'll have to investigate some more with some breakpoints.

Anyway, I can see why it might take a while if it's doing a full walk but I'm surprised to hear that the 'Send to Background' button was disabled. Do you remember what the progress monitor was saying?

-------------------------------------
