Bug 580190 - External merge tools: initial setting reports "no merge tool defined"
Summary: External merge tools: initial setting reports "no merge tool defined"
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 6.2   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 580088
  Show dependency tree
 
Reported: 2022-06-17 07:36 EDT by Thomas Wolf CLA
Modified: 2022-07-06 01:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2022-06-17 07:36:49 EDT
Reproducer:

* Start Eclipse on a fresh workspace
* Import an existing git repository in the Git repositories view (mine
  is a test repo that conveniently is already in rebase w/merge state).
* Open the Git Staging view on that repo.
* In the global preferences choose on the Diff/Merge page "External, use this
  tool" for the merge tool. On my Mac, the list presented is emerge, opendiff,
  vimdiff, vimdiff2, vimdiff3, with the first entry chosen by default (emerge).
* Double click a conflicting file in the unstaged viewer of the Git Staging
  view.

Expected:

An error dialog that the emerge tool could not be started.

Actual:

Nothing happens, except the following error log:

!ENTRY org.eclipse.egit.ui 2 0 2022-06-17 13:25:35.616
!MESSAGE Failed to run external merge tool.
!STACK 0
org.eclipse.jgit.internal.diffmergetool.ToolException: External merge tool is not defined: none
	at org.eclipse.jgit.internal.diffmergetool.MergeTools.merge(MergeTools.java:161)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.mergeModified(MergeToolActionHandler.java:197)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.executeExternalToolForChildren(MergeToolActionHandler.java:138)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.executeExternalToolForChildren(MergeToolActionHandler.java:134)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.openMergeToolExternal(MergeToolActionHandler.java:123)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.execute(MergeToolActionHandler.java:98)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommandInContext(LegacyHandlerService.java:440)
	at org.eclipse.egit.ui.internal.CommonUtils.runCommand(CommonUtils.java:218)
	at org.eclipse.egit.ui.internal.CommonUtils.runCommand(CommonUtils.java:182)
	at org.eclipse.egit.ui.internal.staging.StagingView.compareWith(StagingView.java:3105)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:802)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:799)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1118)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:270)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:310)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4443)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3839)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	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:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

There are three problems here:

1. The message claims no tool was selected. But the UI showed "emerge" to be
   active. Probably some initial setting is missing in the preferences.
2. The message is only logged; the user is not informed.
3. The Git Staging view shows three untracked files for the BASE, LOCAL, and
   REMOTE versions. Evidently they were created, then the tool run failed,
   and the files were not cleaned up.
Comment 1 Thomas Wolf CLA 2022-06-17 07:41:03 EDT
Then continue:

* Open the preference page again, choose "opendiff" as merge tool, then choose
  "emerge" again. Click "Apply".
* Double-click the conflicting file in the Git Staging view again.

Again, there's no user feedback, and the BASE, REMOTE, LOCAL files are not removed, but the error logged changes:

ENTRY org.eclipse.egit.ui 2 0 2022-06-17 13:35:58.309
!MESSAGE Failed to run external merge tool.
!STACK 0
org.eclipse.jgit.internal.diffmergetool.ToolException: JGit: tool execution return code: 1
checkExitCode: true
execError: false
stderr: 
emacs: standard input is not a tty

	at org.eclipse.jgit.internal.diffmergetool.CommandExecutor.run(CommandExecutor.java:84)
	at org.eclipse.jgit.internal.diffmergetool.MergeTools.merge(MergeTools.java:207)
	at org.eclipse.jgit.internal.diffmergetool.MergeTools.merge(MergeTools.java:165)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.mergeModified(MergeToolActionHandler.java:197)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.executeExternalToolForChildren(MergeToolActionHandler.java:138)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.executeExternalToolForChildren(MergeToolActionHandler.java:134)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.openMergeToolExternal(MergeToolActionHandler.java:123)
	at org.eclipse.egit.ui.internal.actions.MergeToolActionHandler.execute(MergeToolActionHandler.java:98)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommandInContext(LegacyHandlerService.java:440)
	at org.eclipse.egit.ui.internal.CommonUtils.runCommand(CommonUtils.java:218)
	at org.eclipse.egit.ui.internal.CommonUtils.runCommand(CommonUtils.java:182)
	at org.eclipse.egit.ui.internal.staging.StagingView.compareWith(StagingView.java:3105)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:802)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:799)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1118)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:270)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:310)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4443)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3839)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	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:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

Hence my assumption that some initial preference setting is missing.
Comment 2 Simeon Andreev CLA 2022-06-17 08:10:41 EDT
I'll take a look next week, thanks.
Comment 3 Eclipse Genie CLA 2022-06-20 05:01:03 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/194301
Comment 5 Simeon Andreev CLA 2022-06-22 04:07:21 EDT
Thomas, can you re-test?
Comment 6 Thomas Wolf CLA 2022-06-22 05:21:32 EDT
Logs now correctly the error from comment 1.

Interestingly I cannot reproduce the "temp files not cleaned up" bit anymore.
Don't understand why.

Of course there's still no user feedback.
Comment 7 Eclipse Genie CLA 2022-06-23 04:26:35 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/194360