tags:

views:

130

answers:

3

I've been making changes that involved moving methods around, extracting new methods, and changing functionality a small amount (not all at the same time, but within the same revision - maybe that was a bad decision).

Conventional diffing seems to generate diffs that report that method doFoo was deleted at line 42, and that an almost identical method that is also called doFoo was created at line 2012. Is it easy to ask a diffing program to compare the doFoo deleted at line 42 with the doFoo created at 2012? (Preferably a diff program that is free and available on Ubuntu)

+1  A: 

Ediff, the diff tool included with emacs, will help you examine these regions.

You may run into situations when a large chunk of text in one file has been edited and then moved to a different place in another file. In such a case, these two chunks of text are unlikely to belong to the same difference region, so the refinement feature of Ediff will not be able to tell you what exactly differs inside these chunks. Since eyeballing large pieces of text is contrary to human nature, Ediff has a special command to help reduce the risk of developing a cataract.

Steven Huwig
A: 

See SmartDifferencer for a tool that understands language syntax and abstract editing commands such as "move this block of code from line A to line B", "rename this variable everywhere in scope". Presently available for Java and COBOL, other languages following Real Soon.

EDIT 9/4/2009: C# added...

Ira Baxter
A: 

http://www.research.ibm.com/visual/projects/history_flow/gallery.htm

Never used it myself but the images look cool :P