DESCRIPTION

[RFC] 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.

[ms]:
- rebased to current master
- fix unhandled InvocationTargetException in StagingView.java

[bl]
- rebased original implementation from Remy (I5fb81a1811cf6f2aff22016438c664fc5014b9a5)
- initial attempt to remove deprecated api usage
- requires jgit change I43c13eb72a44f80135c93525fce0c0280b0e64a2 for
  conflict support in IndexDiff

Change-Id: I7d78aff4db32d864ac0410a178bad149c45b6440
CQ: 4125
Bug: 313263
Also-by: Jaylon Avila xxx@xxx.xxx
Also-by: Douglas Trujillo xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2011-04-14 14:37:54.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/383/ 

-------------------------------------
author: Brenden Conley
date: 2011-04-14 14:39:37.000000000

Patch Set 1: Build Failed

Build Failed 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/383/ : FAILURE

-------------------------------------
author: Imani Waller
date: 2011-04-14 14:41:19.000000000

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

This is work-in progress.  Feedback welcome.

-------------------------------------
author: Douglas Trujillo
date: 2011-04-29 19:52:27.000000000

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

(15 inline comments)

I did some testing and compared this view with the staging/commit view provided by GitX.
I think the UI should rather follow what GitX does, I think this is close to optimal.

I would propose to do the following changes:
- add a combo to select the repository, if you feel you really need a way to have a staging view for all repositories add an entry "<all>" to this combo, I think looking at staged changes for multiple repos isn't really useful and requires more scrolling
- divide the staging view horizontally into three panes in the same way as GitX does:
   - list of unstaged files in the left pane, decorate modified, deleted, untracked files with different decorators, this removes the need for a lot of tree nodes
   - draft for commit message in the middle (could reuse the new stuff done by Kevin)
   - list of staged change on the right side, decorate to show details about staged changes
- I would prefer flat file lists as this removes the need to open/collapse unnecessary tree nodes which also eat up vertical screen real estate (compare the two screenshots I attached to bug 313263 comparing current EGit proposal and GitX)

Line:48, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/ResourceNode.java -> style nit: we don't use curly braces around single line blocks

Line:68, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/ResourceNode.java -> style nit: no braces here

Line:173, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> style nit: no braces around single line blocks, more below

Line:614, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> error message should be exernalized

Line:938, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> what's the purpose of this commented out code ?

Line:983, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> can we find a better name for this method ?

Line:986, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> bad indentation

Line:1005, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> I think we should be able to also handle files outside the workspace, we got many complaints about this blind spot in the existing commit dialog. Support for this could also be added in a later commit.

Line:1064, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> why commented out code ?

Line:102, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingLabelProvider.java -> style nit: no braces, more occurrences below

Line:1, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/OpenCommand.java -> missing license header

Line:23, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/ConflictingNode.java -> label should be externalized

Line:23, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagedNode.java -> label should be externalized

Line:21, /COMMIT_MSG -> The changeId should go on the next line to avoid to wide line

Line:27, /COMMIT_MSG -> this CQ has been withdrawn, so we will need a new CQ for this change (we'll request that when we are closer to accepting the proposal)

-------------------------------------
author: Imani Waller
date: 2011-04-30 10:44:04.000000000

Patch Set 1: (13 inline comments)

Patchset 2 just addresses the style implementation issues, next up refactor the view to a gitx style.

Line:48, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/ResourceNode.java -> Done

Line:68, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/ResourceNode.java -> Done

Line:173, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:614, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:938, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Thats from Remy's original implementation which used a different API from IndexDiff.  Don't think its required anymore so I've removed it now.

Line:983, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:986, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:1005, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Definitely need support for non workspace files.  The current code uses IFile to track the nodes,

Line:1064, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:102, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingLabelProvider.java -> Done

Line:1, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/OpenCommand.java -> Done

Line:23, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/ConflictingNode.java -> Done

Line:23, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagedNode.java -> Done

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