Diff applications going crazy if the functions in the file were reordered Diff applications going crazy if the functions in the file were reordered windows windows

Diff applications going crazy if the functions in the file were reordered


BeyondCompare (and probably other tools as well) has a feature where you can choose a line and select which line in the other file to use as a reference. That way you can at least compare each method one by one. Depending on how many methods you have this might be an option. However it still requires some manual and probably tedious work.

The other way simply would be to rearrange the methods without changing anything and checking it in. Then once you have the rearranged class you can use a diff tool for any changes you make within each method.


Traditional text differences are based only in textual content. For this reason you see the 80% of the file content as changed.

Plastic SCM has a smart differencer called XDiff. It's able to find differences in moved or refactored code. Take a look to this post to learn more about XDiff. It works also for merge support.

Plastic SCM is a complete SCM solution. You can install it and use only the diff/merge tool.


What you need is a tool that understands code structures (expressions, statements, declaration, functions) and the kinds of operations you do to them: insert, delete, move, copy, copy-and-rename, etc. You sound like you've done a bunch of "code moves".Textual diff programs by definition can't do this.

Our Smart Differencer can do this for many languages: C#, C++, COBOL, Java, PHP, ...It reports differences in terms of language constructs, and is precise to the line/column.