Bug 538554

Summary: Compare should detect and show moved blocks of lines
Product: [Eclipse Project] Platform Reporter: David Balažic <david.balazic>
Component: CompareAssignee: Platform-Compare-Inbox <platform-compare-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: gautier.desaintmartinlacaze
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description David Balažic CLA 2018-09-03 10:08:01 EDT
When a block of lines is moved, it should be detected and displayed.

Example:

 - one document
1
2
3
4
5
6

 - other document
4
5
1
2
3
6

Comparing them currently shows:
 - 
 - 3 lines before the last line were added

By this proposal, it should display this information:
 - 3 lines at beginning were moved to before the last number

This way the user knows, that the two blocks are actually the same.

For example in a Java source code, a moved method would be displayed as "method moved (ergo: no real change)" instead of current "a method was removed" and "a method was added".

There is some discussion about algorithms and existing product that do this here:
 - https://stackoverflow.com/questions/10066129/is-there-a-diff-like-algorithm-that-handles-moving-block-of-lines
 - http://www.donationcoder.com/forum/index.php?topic=35448.0
Comment 1 David Balažic CLA 2018-09-03 10:09:03 EDT
Sorry, a typo:

It should say:

Comparing them currently shows:
 - 3 lines from the beginning were deleted
 - 3 lines before the last line were added