Bug 563731 - Do you have time to provide `Unified diff` View while comparing text
Summary: Do you have time to provide `Unified diff` View while comparing text
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 4.16   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-29 10:07 EDT by Gao Hao CLA
Modified: 2020-05-30 04:09 EDT (History)
2 users (show)

See Also:


Attachments
Unified diff in JetBrains (98.94 KB, image/png)
2020-05-30 02:10 EDT, Gao Hao CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gao Hao CLA 2020-05-29 10:07:36 EDT
I personally think Unified diff is helpful.
Comment 1 Thomas Wolf CLA 2020-05-29 10:27:04 EDT
EGit does provide unified diffs in several places, but not inside the Eclipse compare editor. Don't know the that side-by-side compare editor, which doesn't come from EGit, would have some extension through which EGit could provide additional buttons or commands.

Would probably also need some code changes in EGit's unified diff "editor" to be able to give it single-file inputs (which could come from a commit, the workspace, or the index).
Comment 2 Thomas Wolf CLA 2020-05-29 10:29:34 EDT
(In reply to Thomas Wolf from comment #1)
> Don't know the that side-by-side compare editor,
s/the/if/

"Don't know if that side-by-side compare editor," of course.
Comment 3 Thomas Wolf CLA 2020-05-29 10:50:27 EDT
Also, what exactly is meant by "unified diff"? The EGit unified diffs are read-only, and show hunks, like in

@@ -1,1 +1,1 @@
 A context line
-A removed line
+An added line
 Another context line

That's maybe useful for looking at differences (though one has less context available), but not useful for actually copying some changes over, as in resolving a merge conflict.

Perhaps it would be more useful for the user to open a (read-write, if one side is writeable) editor that shows all differences using the <<<<<, =====, >>>> markers? Like in

A context line
<<<< Some commit X
A removed line
====
An added line
>>>> Some commit Y

And if the editable input already is a pre-merged file with conflict markers, or the editable side has such a pre-merged file on disk, just open that in a (read-write) editor?

Then the user can actually use the opened editor to resolve merge conflicts.

Or do the first (hunks) if neither side is editable, and the second (conflict markers) if one side _is_ editable?

What if both sides are editable? (Comparison of working tree file against index)?
Comment 4 Gao Hao CLA 2020-05-30 02:02:32 EDT
不知道你在说什么。
为什么JetBrains可以实现Unified diff,而你却在唧唧歪歪?
Comment 5 Gao Hao CLA 2020-05-30 02:10:14 EDT
Created attachment 283098 [details]
Unified diff in JetBrains

给你们提建议,你们就这有问题那有问题,就是不愿意实现。
为什么JetBrains的有这个功能?人家JetBrains是吃饱了撑了吗?
Comment 6 Thomas Wolf CLA 2020-05-30 04:09:19 EDT
(In reply to Gao Hao from comment #5)
> Created attachment 283098 [details]
> Unified diff in JetBrains
> 
> 给你们提建议,你们就这有问题那有问题,就是不愿意实现。
> 为什么JetBrains的有这个功能?人家JetBrains是吃饱了撑了吗?

Thanks for the screenshot, but I can't read Chinese.

You mean an editable unified diff viewer. Something like that would have to be provided by the Platform/Compare component, not by EGit. 

I'm moving this suggestion there.