Bug 561971 - REGRESSION: Delete Branch button on the Checkout dialog not working
Summary: REGRESSION: Delete Branch button on the Checkout dialog not working
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.7   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-09 15:22 EDT by Sam Gabriel CLA
Modified: 2022-08-23 12:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Gabriel CLA 2020-04-09 15:22:06 EDT
Using   
Git integration for Eclipse - UI	5.7.0.202003110725-r	org.eclipse.egit.ui	Eclipse EGit

When clicking the Checkout branch dialog it shows all the local and remote branches. Generally after creating a new branch i would go into the dialog and delete the other local branches that are merged or no longer needed.

About three months ago the Delete branch button stopped working when you click on it nothing happens. No errors in the error log or such. 

Only way to delete the branch is using the Repositories view. Always using the latest stable release.

Eclipse IDE for Enterprise Java Developers.

Version: 2020-03 (4.15.0)
Build id: 20200313-1211
Comment 1 Thomas Wolf CLA 2020-04-10 07:41:21 EDT
I presume you mean the dialog reachable from the package explorer, on a project, Context Menu->Team->Switch To...->Other... ? Works for me on Mac.
Comment 2 Michael Keppler CLA 2020-04-12 13:00:19 EDT
This is implemented by calling the EDIT_DELETE command of the workbench. Therefore this might even be affected by some other plugin outside of egit. I suggest we add an exception handler to org.eclipse.egit.ui.internal.CommonUtils.runCommand(String, IStructuredSelection), line 205, since we currently just ignore any CommandException that might be thrown there. Similarly we ignore exceptions when collecting the branches to be deleted in org.eclipse.egit.ui.internal.repository.tree.command.DeleteBranchCommand.getRefsToDelete(List<RepositoryTreeNode>), line 117.
Comment 3 Sam Gabriel CLA 2020-04-14 21:49:45 EDT
@Thomas Wolf I actually customize the prospective to show the Git Commands on the Command line. Usually I use these commands to do quick checkout/commits/deletes
Comment 4 Thomas Wolf CLA 2020-04-15 04:02:24 EDT
(In reply to Sam Gabriel from comment #3)
> @Thomas Wolf I actually customize the prospective to show the Git Commands
> on the Command line. Usually I use these commands to do quick
> checkout/commits/deletes

I don't understand what you do. If you are using code to achieve this, perhaps that code interferes somehow?
Comment 5 Sam Gabriel CLA 2020-04-16 21:16:47 EDT
@Thomas Wolf I apologize i was not clear in my comment. I meant, I customize the perspective toolbar to show the Git Command. This way all the git commands are available on the toolbar and I can just click Checkout and do all the actions needed. Today I noticed something odd, I usually have the error view collapsed. So if I click on the Error View to bring up dialog then Click on the Editor of the repo that i want to delete a branch from. Then Click on the Checkout icon on the toolbar it would work.
Comment 6 Thomas Wolf CLA 2020-04-17 02:25:20 EDT
I see. Yes, that dialog is also available from the Git toolbar directly. Works for me on Mac.

We'll have to follow Michael's suggestion in comment 2: add more logging.
Comment 7 Eclipse Genie CLA 2020-04-17 03:19:53 EDT
New Gerrit change created: https://git.eclipse.org/r/161121
Comment 8 Eclipse Genie CLA 2020-04-17 05:56:04 EDT
Gerrit change https://git.eclipse.org/r/161121 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=f8b4e140d0d5c892bb106f0f970b3c4c9411a8d3
Comment 9 Thomas Wolf CLA 2020-04-17 07:49:20 EDT
Additional logging is now in EGit nightly. If you install/update EGit from the update site https://download.eclipse.org/egit/updates-nightly you might perhaps get some errors in the Eclipse log for this problem. Perhaps that gives us some more clues as to what might be going wrong.
Comment 10 Sam Gabriel CLA 2020-04-20 11:50:50 EDT
Here is the error log
!ENTRY org.eclipse.egit.ui 4 0 2020-04-20 11:49:46.090
!MESSAGE Could not run command org.eclipse.ui.edit.delete
!STACK 0
org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.edit.delete
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:501)
	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:200)
	at org.eclipse.egit.ui.internal.dialogs.BranchSelectionAndEditDialog$3.widgetSelected(BranchSelectionAndEditDialog.java:263)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4105)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3922)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.egit.ui.internal.actions.BranchActionHandler.execute(BranchActionHandler.java:36)
	at org.eclipse.egit.ui.internal.actions.RepositoryAction.run(RepositoryAction.java:80)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:239)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:579)
	at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4105)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3922)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	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:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)

!ENTRY org.eclipse.egit.ui 4 0 2020-04-20 11:49:49.125
!MESSAGE Could not run command org.eclipse.ui.edit.delete
!STACK 0
org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.edit.delete
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:501)
	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:200)
	at org.eclipse.egit.ui.internal.dialogs.BranchSelectionAndEditDialog$3.widgetSelected(BranchSelectionAndEditDialog.java:263)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4105)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3922)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.egit.ui.internal.actions.BranchActionHandler.execute(BranchActionHandler.java:36)
	at org.eclipse.egit.ui.internal.actions.RepositoryAction.run(RepositoryAction.java:80)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:239)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:579)
	at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4105)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3922)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	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:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
Comment 11 Sam Gabriel CLA 2020-04-20 11:57:37 EDT
So after getting this error if I expand the Error Log view and then try to delete the branch again it deletes fine. 
2. open the dialog click New Branch
3. Open the dialog and click delete Branch (does not work) and no more error in the log.
4. Expand the Error Log View again 
5. Open the Checkout Dialog click Delete Branch now works.
Comment 12 Sam Gabriel CLA 2020-04-20 11:58:45 EDT
NVM regarding Step 3 the error is in the log file
Comment 13 Thomas Wolf CLA 2020-04-21 05:56:15 EDT
"There is no handler to execute for command org.eclipse.ui.edit.delete" -- strange. Cannot reproduce on Mac. Perhaps it's specific to Windows, or to your particular Eclipse setup.
Comment 14 Sam Gabriel CLA 2022-08-23 12:27:50 EDT
This issue is still very much present. Here are my eclipse and exception details
As mentioned previously, steps to reproduce:
1. Customize the prospective so that the Git Commands are shown on the top toolbar. Make sure the Git Staging and Git Repositories View are collapsed in a separate pane.
2. Open a project with git then click the button on the toolbar to create a new branch using the dialog.
3. Select another branch from the dialog then click Delete nothing happens
Workaround:
4. Close the Dialog
5. Open the Git Staging View
6. Click on the Checkout button on the toolbar again, select the branch then click Delete (now the branch is deleted)

This happens on a new workspace and even a fresh vanilla eclipse with no plugins. 
This also happens after each time user creates a new branch not just the first time.
Seems that opening the collapsed Git Staging/Git Repositories view registers something that make the dialog work but that registration is deleted afterwards.
The workspace has multiple projects and multiple git repositories.

eclipse.buildId=4.24.0.I20220607-0700
java.version=15.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64

This is a continuation of log file C:\Users\sgabriel\Workspaces\2022-06\.metadata\.bak_0.log
Created Time: 2022-08-22 17:20:39.373


org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.edit.delete
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:501)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	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.dialogs.BranchSelectionAndEditDialog$3.widgetSelected(BranchSelectionAndEditDialog.java:263)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.egit.ui.internal.actions.BranchActionHandler.execute(BranchActionHandler.java:36)
	at org.eclipse.egit.ui.internal.actions.RepositoryAction.run(RepositoryAction.java:80)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:239)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
	at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	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:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	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:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)