Community
Participate
Working Groups
Open some file from repository in the editor. Open History view. Make sure the view is in "compare mode" (button is toggled) Select commit NOT containing the file we just opened. Now double click this *commit* in the history view. AS IS: The opened diff editor shows diff on active editor file, NOT on file in selected commit. This makes no sense at all. TO BE: The opened diff editor shows diff on the selected (first) file in the selected commit. Related code is in IOpenListener from org.eclipse.egit.ui.internal.history.CommitGraphTable.CommitGraphTable(Composite, IPageSite, MenuManager, TableLoader, ResourceManager) and ShowVersionsHandler.
The code in ShowVersionsHandler makes no sense. The command tries to detect current file for the diff operation from the history view *input*, but I can have the history opened on a file but see the commits from the entire repo! OMG.
Created attachment 270342 [details] Example repo / project Simple repo/project demonstrating the problem. Open .project and a.txt files and try to play with the history view (linked mode + compare mode must be both on).
Expected: the double click on commit in "compare mode" must do something like org.eclipse.egit.ui.internal.history.CommitFileDiffViewer.CommitFileDiffViewer().new IOpenListener() {...}.() or org.eclipse.egit.ui.internal.history.CommitFileDiffViewer.compare.
The commit history moreover must evidently not be filtered to that resource. What should happen is debatable. If the history input is not for a specific resource (click on the repo in the repo view), a double click currently doesn't do anything, and there is no "Compare with workspace" in the context menu either. So not doing anything for commits not containing the "current" history input resource would be even more consistent. If we wanted a comparison in such cases, it should be a structure comparison of all files in that commit against the working tree, not just a comparison of the "first" file in that commit.