DESCRIPTION

Fix expansion problems and provide auto selection support.

Bug: 451216
Change-Id: I748f61ec41fe34b3cee9612ed8dc156bd29b5812
Signed-off-by: Ronan Romero xxx@xxx.xxx

COMMENTS

author: Ronan Romero
date: 2016-08-10 13:04:13.000000000

Uploaded patch set 2: Commit message was updated.

-------------------------------------
author: Brenden Conley
date: 2016-08-10 13:04:20.000000000

Patch Set 2:

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

-------------------------------------
author: Ronan Romero
date: 2016-08-10 13:07:22.000000000

Patch Set 2:

Ah, I see, not all commits in the recent history have this annotation, but some do.

Thanks for responding so quickly! I've spent the whole week on this...

-------------------------------------
author: Brenden Conley
date: 2016-08-10 13:32:29.000000000

Patch Set 2: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/8950/ : UNSTABLE

-------------------------------------
author: Jayvion Booth
date: 2016-08-10 13:52:50.000000000

Patch Set 2:

> I see it has a conflict now.  Bad timing.  Should I take action?

I'm not sure what do you mean by conflict?

The hudson had a test failure, most likely caused by the change, see https://hudson.eclipse.org/egit/job/egit.gerrit/8950/testReport/junit/org.eclipse.egit.ui.view.repositories/GitRepositoriesViewTest/testExpandWorkDir/

-------------------------------------
author: Brenden Conley
date: 2016-08-10 13:53:36.000000000

Patch Set 2: -Code-Review

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

-------------------------------------
author: Jayvion Booth
date: 2016-08-10 13:54:33.000000000

Patch Set 2:

> Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/8951/

Sorry, the test seem to be unrelated to your changes. I've retriggered hudson build. Unfortunately our UI tests are not as stable as they should be :-(

-------------------------------------
author: Ronan Romero
date: 2016-08-10 14:21:39.000000000

Patch Set 2:

> > Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/8951/
 > 
 > Sorry, the test seem to be unrelated to your changes. I've
 > retriggered hudson build. Unfortunately our UI tests are not as
 > stable as they should be :-(

Yes, the first build was good.  In any case, I tried to run it locally, and it passed.

BTW, I'll also update the Oomph setup so it works for master again.  I needed to include some more swtbot things to make the test run, so that was good to discover.

-------------------------------------
author: Brenden Conley
date: 2016-08-10 14:27:19.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8951/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2016-08-11 20:15:17.000000000

Patch Set 2:

(8 comments)

Works nicely. In my tests, I sometimes wished the viewer moved after a remove of the first few children of a parent not to the parent but to the first child following. But even so it's already a huge improvement over the former behavior.

Line:1947, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Should be newInput, I think.

Line:1968, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Nit: strange auto-formatting.

Line:1978, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Shouldn't this comment be javadoc on updateSelection()?

Line:2084, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Nit: strange auto-formatting.

Line:2101, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Personally I find using Boolean to implement tri-state logic confusing. Why not a dedicated enum with three literals  ADDED, REMOVED, UNCHANGED?

Line:2101, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> How do you decide whether to make a method static or not? The above two are static, this isn't (but could be)...

I also wonder if this whole logic could and should be factored out into a separate class.

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

Line:3482, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Please add missing braces (also in the legacy for-loop just above).

-------------------------------------
author: Alayna Houston
date: 2016-08-11 21:10:53.000000000

Patch Set 2:

(1 comment)

Line:2101, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> The "return null" below also causes a FindBugs warning.

-------------------------------------
author: Ronan Romero
date: 2016-08-12 06:36:17.000000000

Patch Set 2:

Thomas, thanks so much for the timely review!  I know such things are time consuming and I really appreciate the detailed feedback. Being fussy is great because the state of the code reflects a love for details. I'll address all the issues you raised before next week and submit a new patch.

-------------------------------------
author: Ronan Romero
date: 2016-08-12 08:14:47.000000000

Patch Set 2:

(1 comment)

I've addressed all the issues you've raised.  I also liked your idea of selecting a subsequent sibling instead of the parent in the case of removing the first child of some parent.

With regard to the indexDiff testing, I noticed that if you have an editor open for some unstaged resource, there are many calls to setInput, and the first few have indexDiff == null, so this test is needed to avoid selecting everything for initial population of the viewer.

I'm happy to make any further changes you think would be an improvement.

Line:1947, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> No I hit cases that the repo stayed the same, but the old input's indexDiff was null so the view was entirely empty.  But I'll test a few corner cases again.  Of course if the new input is entirely empty it doesn't really matter what we do.

-------------------------------------
author: Alayna Houston
date: 2016-08-13 13:55:23.000000000

Patch Set 2:

(1 comment)

Line:1947, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> What I meant is this:

  oldInput.repository == oldInput.repository

is just a convoluted way of saying

  true

and I think you meant

 oldInput.repository == newInput.repository

;-)

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-09-07 06:02:47.000000000

Change has been successfully merged into the git repository by Alayna Houston

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