Community
Participate
Working Groups
To comparing two file in the git log opens up the compare view which opens in side by side view mode. Its good to provide a unified view as another option so that use can configure which view to use depending on the situations. Sometime the unified diff view make sense when we have 90% rotated monitors for viewing code files with lot of lines, this makes a ideal candidate for view large patches as well.
I presume you mean the git history. There are ways to see a unified diff: 1. Select the commit, then select a file in the bottom right list of files changed in that commit. Shows bottom left, below the commit message, a unified diff of the changes (limited to 10000 lines). Or 2. Open the the commit in the Commit Viewer (via the context menu), then switch to the "Diff" tab. This shows a unified diff over all changes done in that commit. Do these two possibilities fulfill your needs?
I actually aware of those two options. I was suggesting for the scenario you select two revisions from log and compare each other.
Sorry, I didn't understand that from your initial description. Changed the title of this enhancement request.
The compare editor was a bit improved for Git diff case. Can you please give a try to a recent build of Platform and see whether this change makes this request still relevant. PS: you mention "comparing 2 commits" and "comparing 2 files", those are different stories, so if it makes sense, please fix the bug title.
I mean comparing two commits which are not continuous, and right click and select "Compare with Each Other", We should be able to choose which kind of comparison viewer which should be use like "side by side" or "unified".
I think if we have the viewer, comparing two files might be trivial to implement.
I implemented a quick and dirty version for our immediate requirements (https://github.com/nittka/egit-extensions/commit/3a15bd9b999e7ad7e8f5df1e9067bb1017362a2e) and usage. When two commits are selected in the history view a third compare with each other menu item is shown. The existing DiffViewer is reused as s source viewer for a new editor with corresponding dummy editor input. I'd like this feature to be part of EGit but I am not quite sure yet, whether it should be a different view/editor or whether an existing one should be generalized. Hence the external proof of concept. This enhancement request may also be related to bug 550673.
(In reply to Alexander Nittka from comment #7) > I implemented a quick and dirty version for our immediate requirements > (https://github.com/nittka/egit-extensions/commit/ > 3a15bd9b999e7ad7e8f5df1e9067bb1017362a2e) and usage. > When two commits are selected in the history view a third compare with each > other menu item is shown. The existing DiffViewer is reused as s source > viewer for a new editor with corresponding dummy editor input. > > I'd like this feature to be part of EGit but I am not quite sure yet, > whether it should be a different view/editor or whether an existing one > should be generalized. Hence the external proof of concept. > > This enhancement request may also be related to bug 550673. It would certainly be nice if the TextEditor stuff from DiffEditorPage could be extracted and re-used. Similar for the associated outline page. I also think modern Eclipses have some support in GenericEditor for patch/diff files. (But I don't think it has our hyperlinking, and I don't know about its syntax coloring.)
New Gerrit change created: https://git.eclipse.org/r/157560
New Gerrit change created: https://git.eclipse.org/r/157561
New Gerrit change created: https://git.eclipse.org/r/157563
New Gerrit change created: https://git.eclipse.org/r/157562
New Gerrit change created: https://git.eclipse.org/r/157565
New Gerrit change created: https://git.eclipse.org/r/157564
New Gerrit change created: https://git.eclipse.org/r/157566
(In reply to Thomas Wolf from comment #8) > It would certainly be nice if the TextEditor stuff from DiffEditorPage could > be extracted and re-used. Similar for the associated outline page. This series of commits does that, and adds "Show Unified Diff" commands to the history, reflog, and interactive rebase views. Adding comparisons between two refs selected in the repositories view is not done; that's the subject of bug bug 550673.
Gerrit change https://git.eclipse.org/r/157560 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=f5520ec96045cd64b1f807fa57c5a88483a9a7d7
Gerrit change https://git.eclipse.org/r/157561 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=bf86d9efd911693ec87b2694393f5f7de1fa70ba
Gerrit change https://git.eclipse.org/r/157566 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=9c4273f90c547b741895b2cbd8953824779da746
Gerrit change https://git.eclipse.org/r/157565 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=6aa02c69fbf239eb1d7d69dbafc3c360df37c10a
Gerrit change https://git.eclipse.org/r/157564 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=bda50a6bacc6af13e7dd5a7107140e2bf6dd8b19
Gerrit change https://git.eclipse.org/r/157563 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=b766c0a7c003940505e3fb16d327b10db974559b
Gerrit change https://git.eclipse.org/r/157562 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=b1d2bba6ac28a8399ba5abd9aaefb41456c3d9f3