Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

windows

diff

I've been busy refactoring a file in our project and as part of my changes I reordered the function to a more logical way. However, now when I'm trying to review my changes I get a mess: The diff applications has no idea that the functions were merely reordered and marks 80% of the file content as changed.

I've tried to see the diff with both "Beyond Compare" and "WinMerge" to the same result. Is there some setting that might help me here?

As tagged, I am using C# on Windows.

like image 428
VitalyB Avatar asked Jan 01 '11 23:01

VitalyB


1 Answers

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.

like image 114
Anne Schuessler Avatar answered Sep 20 '22 23:09

Anne Schuessler