Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359308

Summary: History "Compare with Each Other" shows error dialog "Empty Path Not Permitted"
Product: [Technology] EGit Reporter: James Moger <james.moger>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: remy.suen
Version: 1.1   
Target Milestone: 1.2-M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description James Moger CLA 2011-09-28 17:12:11 EDT
Build Identifier: 20110916-0149

History "Compare with Each Other" shows error dialog "Empty Path Not Permitted".  It does not open any compare window.  I've tried this with multiple pairs of commits in different repositories and its 100% reproducible.

The other menu option "Compare with Each Other in Tree" WORKS, but makes me wonder why there are 2 compare menu options at all?  Subversive and Subclipse only have a single compare - and its a tree compare too.

Reproducible: Always
Comment 1 Remy Suen CLA 2011-10-02 12:57:59 EDT
(In reply to comment #0)
> History "Compare with Each Other" shows error dialog "Empty Path Not
> Permitted".  It does not open any compare window.  I've tried this with
> multiple pairs of commits in different repositories and its 100% reproducible.

Please provide the steps to reproduce this problem.
Comment 2 James Moger CLA 2011-10-03 08:13:16 EDT
Ok.  That's just weird.  Now its 100% not reproducible - in fact only "Compare with Each Other" is ever listed in the context menu.  "Compare with Each Other in Tree" never appears.  Perhaps Eclipse was loading the 1.0 jars? and/mixing them together?  I have no idea.  Maybe this issue should be closed as it seems to work fine now.
Comment 3 Remy Suen CLA 2011-10-04 18:48:09 EDT
I'm not positive on what will cause the problem yet but I am seeing the problem also.

Thread [main] (Suspended (breakpoint at line 1845 in Shell))	
	Shell.setVisible(boolean) line: 1845	
	Shell.open() line: 1229	
	MessageDialog(Window).open() line: 797	
	MessageDialog.open() line: 334	
	MessageDialog.open(int, Shell, String, String, int) line: 364	
	MessageDialog.openError(Shell, String, String) line: 431	
	CompareUIPlugin.compareResultOK(CompareEditorInput, IRunnableContext) line: 597	
	CompareUIPlugin.openCompareEditor(CompareEditorInput, IWorkbenchPage, IReusableEditor, boolean) line: 495	
	CompareUI.openCompareEditorOnPage(CompareEditorInput, IWorkbenchPage, boolean) line: 168	
	CompareUI.openCompareEditor(CompareEditorInput, boolean) line: 137	
	CompareUI.openCompareEditor(CompareEditorInput) line: 121	
	CompareUtils.openInCompare(IWorkbenchPage, CompareEditorInput) line: 230	
	CompareVersionsHandler(AbstractHistoryCommandHandler).openInCompare(ExecutionEvent, CompareEditorInput) line: 71	
	CompareVersionsHandler.execute(ExecutionEvent) line: 73	
	HandlerProxy.execute(ExecutionEvent) line: 293
Comment 4 Remy Suen CLA 2011-10-04 18:51:13 EDT
java.lang.IllegalArgumentException: Empty path not permitted.
	at org.eclipse.jgit.treewalk.filter.PathFilter.create(PathFilter.java:80)
	at org.eclipse.egit.ui.internal.merge.GitCompareEditorInput.buildDiffContainer(GitCompareEditorInput.java:240)
	at org.eclipse.egit.ui.internal.merge.GitCompareEditorInput.prepareInput(GitCompareEditorInput.java:198)
	at org.eclipse.compare.CompareEditorInput.run(CompareEditorInput.java:484)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 5 Remy Suen CLA 2011-10-04 19:24:21 EDT
It seems like this bug will occur if your project is what you selected the 'History' view to show and the .git folder is also directly in your Eclipse project (right next to the folder's .project file).

Does this match how your Git projects are setup, James?
Comment 6 James Moger CLA 2011-10-04 20:47:43 EDT
Bingo!  .project is in my repo root and by showing history of the project I get both context menu items and "Each Other" blows up with "empty path not permitted".
Comment 7 Remy Suen CLA 2011-10-30 13:30:35 EDT
I have pushed a change set which should fix this problem to Gerrit for review.
http://egit.eclipse.org/r/#change,4443

Thank you for your bug report, James.
Comment 8 Remy Suen CLA 2011-10-30 22:00:08 EDT
(In reply to comment #7)
> http://egit.eclipse.org/r/#change,4443

Dariusz has merged the change set to master.
http://egit.eclipse.org/w/?p=egit.git;a=commit;h=962214abc74f1aa3c3f738089d1d93bd7d2f42e5