DESCRIPTION

Always expand remote branch node in branch selection dialog

This is a minor UX improvement that saves one click in many cases,
especially in case of rebasing on origin/master.

Change-Id: Id17001f256c6d0d095ce315274bcb27673573524
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2011-03-29 14:56:45.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2011-03-29 15:00:35.000000000

Patch Set 1: Build Successful

Build Successful 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/228/ : SUCCESS

-------------------------------------
author: Willow Cantrell
date: 2011-03-29 15:06:26.000000000

Patch Set 1: Build Failed

Not sure if this is the right thing to do. Depending on the use case, you might rather expand the local branches node...
I suggest to either offer a method on the AbstractBranchSelectionDialog to expand some or all nodes (similar to setRootsToShow, maybe the new method could be called setRootsToExpand) and call this from the concrete subclass (in this case the RebaseTargetSelectionDialog).

-------------------------------------
author: Leslie Stephenson
date: 2011-03-29 15:09:50.000000000

Patch Set 1:

I think that it always would be useful. In "worst case" both nodes (local and remote) would be expanded with can be helpful IMHO. As far as I understood this code it will select given branch, or expand local branch node and then expand remote branch node so in many cases both nodes would be expanded with isn't bad idea IMHO

-------------------------------------
author: Willow Cantrell
date: 2011-03-29 15:37:42.000000000

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

>> As far as I understood this code it will select given branch, 

You have a point here indeed, and I guess this is wrong more often than not; rebase is actually an example where it's wrong. Perhaps we need some boolean in the constructor telling the abstract class whether it should select the current branch or not.

Expanding both nodes might look like a good idea in most cases, but that could be done with the method discussed before as well.

On the other hand, I wonder what happens when you start having really many branches and expand both nodes.  Opening the local node might even push the remotes node out of sight so that you'd have to either collapse local or scroll down to get a chance to see the remotes node...

For Rebase, I guess that most of the time you would rebase onto something remote (that's at least my working style). Thus one would probably want to only expand remotes, not local, which again is something you would need the new method for...

-------------------------------------
author: Leslie Stephenson
date: 2011-03-29 20:01:30.000000000

Patch Set 1:

OK, I've implemented this behavior. Now remote branches are only expanded in rebase dialog, also current branch is only selected in branch dialog.

Additionally I've split setRootsToShow() methods into four additional methods that are more descriptive than four boolean parameters. IMHO this way it is more readable what we want to achieve and I just don't like methods that have more then two parameter in the same type.

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