Bug 538554 - Compare should detect and show moved blocks of lines
Summary: Compare should detect and show moved blocks of lines
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 4.6   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-03 10:08 EDT by David Balažic CLA
Modified: 2018-09-07 11:04 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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