DESCRIPTION

Interactive rebase view can now be linked to project selection

Interactive rebase view linking will now react to selections not only in
the git repositories view. Most notably it will react to project
selection in the project explorer.

Bug: 444660
Change-Id: Ie6d4d156f5ee37dd6de3a641199f02fe652e8976
Signed-off-by: Anahi Horn xxx@xxx.xxx

COMMENTS

author: Anahi Horn
date: 2014-09-22 22:56:56.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-09-22 23:26:59.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-09-22 23:46:18.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2014-09-30 23:03:49.000000000

Patch Set 1: Code-Review-1

I would squash these 3 changes as individually they aren't really useful

I found the following problems
* when selecting a project set the interactive rebase view says "No repository selected" but the step list isn't cleared
* when selecting the entry "JRE system library" under a project shared with git team provider the interactive rebase view says "No repository selected", step list isn't cleared, I think instead we should still show the corresponding repository
* when selecting a closed project I hit an NPE:

!STACK 0
java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.rebase.RebaseInteractiveView.setInput(RebaseInteractiveView.java:196)
	at org.eclipse.egit.ui.internal.rebase.RebaseInteractiveView$6.selectionChanged(RebaseInteractiveView.java:483)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:218)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService.handlePostSelectionChanged(SelectionService.java:122)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$1(SelectionService.java:112)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService$3.selectionChanged(SelectionService.java:80)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$4.run(SelectionAggregator.java:166)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyPostListeners(SelectionAggregator.java:163)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.access$8(SelectionAggregator.java:160)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$8$1.run(SelectionAggregator.java:272)
	at org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:56)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$8.changed(SelectionAggregator.java:269)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
	at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.setPostSelection(SelectionServiceImpl.java:36)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart$3.selectionChanged(CompatibilityPart.java:126)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:876)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:873)
	at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1217)
	at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1243)
	at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:265)
	at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:259)
	at org.eclipse.jface.util.OpenStrategy$1$2.run(OpenStrategy.java:440)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3983)
	at org.eclipse.swt.widgets.Display.observerProc(Display.java:3573)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4989)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5367)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
	at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1101)
	at org.eclipse.swt.widgets.Tree.mouseDownSuper(Tree.java:2044)
	at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1093)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2563)
	at org.eclipse.swt.widgets.Tree.mouseDown(Tree.java:2012)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5627)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2105)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2329)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5691)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5128)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5277)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

-------------------------------------
author: Anahi Horn
date: 2014-10-18 12:06:37.000000000

Patch Set 1:

Sorry for the delay and thanks for finding all these issues!

>I would squash these 3 changes as individually they aren't really useful

Done. Squashed into https://git.eclipse.org/r/#/c/33735/ . This change will be abandoned.

> I found the following problems
>
>    when selecting a project set the interactive rebase view says "No repository selected" but the step list isn't cleared

I haven't found where "project set" can be selected (maybe you ment "working set"?), there is no new node present in any "explorer" views after importing PSF. However, I think that this issue has the same origin as the next one. If the problem is still present in the second patch set of the https://git.eclipse.org/r/#/c/33735/ , then please provide short instruction on how to create and select a "project set".

>    when selecting the entry "JRE system library" under a project shared with git team provider the interactive rebase view says "No repository selected", step list isn't cleared, I think instead we should still show the corresponding repository

The list is cleared now.

As for displaying corresponding repository - "Git Staging" or "History" views don't display corresponding repositories on classpath entries selection either. o.e.jdt.internal.ClassPathContainer can't be adapted to IResource and there seems to be no way to extract corresponding project from it without depending on JDT internal package. That said, I'm willing to update these views to display repositories on classpath entries selection if there is some proper way to do it.

Please note that Rebase Interactive behavior is currently somewhat different from "Git Staging" or "History" views: if latter ones do not update selection when classpath entry is selected (i.e. if repository 1 is selected and then "JRE Library" of some project from repository 2 is selected, "Git Staging" will still display repository 1), the former switches to "No repository selected" state. This makes linking behavior not truly consistent across EGit, but I find "Git Staging" behavior slightly confusing. Please, share your opinion on this. If consistensy is preferred - I'll update RI view implementation.

>    when selecting a closed project I hit an NPE:

Fixed.

-------------------------------------
author: Anahi Horn
date: 2014-10-18 12:09:55.000000000

Abandoned

Abandonded if favour of https://git.eclipse.org/r/#/c/33735/

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