[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: Diff Question.

From: Michael Maxwell <mmaxwell_at_casl.umd.edu>
Date: Sat, 6 Sep 2008 15:58:03 -0400

Ryan Schmidt wrote:
> On Sep 5, 2008, at 12:40 AM, Gavin 'Beau' Baumanis wrote:
>
>> I was just wondering how others coped when trying to compare two
>> revisions of a file, but diff (whether it be a GUI-tool or "svn
>> diff" shows the entire document as being 1 big difference?
>
> And why does the diff tool do that?

'diff' algorithms are not perfect. Some versions of 'diff' will not find the minimal diff in certain cases (in fact, I suspect all diff programs have this characteristic for certain rare cases). I have seen versions of diff that have a '-h' parameter that is supposed to do better on large files, although it will be less good at finding minimal diffs. Other diff programs have a '-d' option, which makes them try harder to find the minimal set of differences. It may be that you need to experiment with alternative diff programs (which 'svn diff' can use if you give it the --diff-cmd <diffProgram> arg).

Having said this, I suspect the problem has to do with whitespace, as other posters have suggested. If not newlines, then maybe tabs vs. space characters, or trailing whitespace. (Some editors will automatically trim trailing whitespace.)

   Mike Maxwell

  CASL/ U MD

 
Received on 2008-09-06 21:58:37 CEST

This is an archived mail posted to the Subversion Users mailing list.