M
M
Maxim Moseychuk2016-02-05 01:41:40
git
Maxim Moseychuk, 2016-02-05 01:41:40

How to compare files after rearranging lines?

During the refactoring, the implementations of the methods were sorted by their names. The contents of the lines have not changed, only their sequence (in large blocks).
I have a branch based on the commit before the refactoring. P4merge, kdiff3 and meld failed to merge, they don't find relocations. Is there a difftool that can handle this, or where can I link the blocks manually?
base:

int b() {
    return 1;
}
int c() {
    return 2;
}
int a() {
    return 0;
}

local:
int a() {
    return 0;
}
int b() {
    return 1;
}
int c() {
    return 2;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2016-02-05
@fshp

There are no intersecting movements in the diffs - only lines that have been deleted, changed and added, git stores two copies of the file - before and after, there are no movements or any other similar information.
Such changes must be merged manually in interactive mode. It won't work automatically.

D
dude2012, 2016-02-05
@dude2012

Upload files and compare them Winmerge winmerge.org/?lang=ru - it's free. It is convenient to compare files with it. Cheap and cheerful

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question