tags:

views:

56

answers:

2

Hi, I am not sure if anybody has experienced this. I am working with a very large file having 7000 lines of code. I made a lot of changes and when i compared the file with the repository version, it showed me incorrect differences.

I guess the diff algorithm buffers only limited number of lines ahead/behind for searching the current line, and on failing to find that, it simply shows diff with current line in new file.

One such snapshot > http://picasaweb.google.com/lh/photo/ENwZ4gqXxiCF3SWqVnVAqA?feat=directlink

If anybody knows any workaround, please let me know. Thanks

A: 

What version of eclipse are you using? And what edition? (Java? CDT? ...)

Depending on those data, it could make a difference, since files with several thousand lines are known to be a problem for the diff algorithm.
See this thread for illustration.
And do check, as mentioned in the same thread, your error log to check if any particular message could help you to pinpoint the cause of the failed diff.

VonC
Version: 3.5.0.v20090611a-9gEeG1HFtQcmRThO4O3aR_fqSMvJR2sJBuild id: I20090611-1540
Nayn
A: 

Easy workaround - use another diff tool. I'm serious. I wouldn't waste time splitting up my files, or wondering how to get it to work with Eclipse's diff tool if there's some known issue with really big files.

I recommend Beyond Compare 3. I say this having used many different diff tools. It's not free, but it's worth it. In the rare chance that it gets confused, it allows you to with a couple of clicks realign any areas that it got confused on. I have used it with some pretty large files, and it rocks.

If you're concerned about Eclipse integration, there's even a plugin, BeyondCVS, that allows you to launch your Beyond Compare diffing from the Eclipse right click 'Compare' menus. Its name is kind of misleading though, as it doesn't appear to be related to CVS.

If you need something free, try one of these diff tools instead:

Joshua McKinnon