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

Re: Diff Question.

From: Gavin 'Beau' Baumanis <gavin_at_thespidernet.com>
Date: Sun, 7 Sep 2008 08:33:48 +1000

Hi Mike,

Thanks for the info.
I completely understand that the EOL or whitespace is the most likely
culprit.
When I originally posted, neither of those entered in my mind.

In a follow-up post to the original, I did try to use svn diff wih
the ignore end f line and ignore whitespace switches, but it still
returned the entire document as being different.
(I even tried those switches one at a time too - just to be as
complete as possible in testing.)

My editor (eclipse) certainly does have options for removing trailing
spaces - which is checked, and I also as a force of habit re-indent
all code using TABS if the original code was indented using spaces.

None the less, the gui - dif tool in particular normally shows up the
difference by displaying eol / tab characters as being the difference
on a certain line.
And normally it is a line difference, Ie I end up with a diff showing
100's of differences.

Oddly from what I normally see, the diff is showing the entire file as
simply being 1 complete difference - which when in this particular the
case the file is 1200 lines, makes it a little difficult to pick out
the coding differences.

None the less, thanks for the reply - I appreciate your thoughts and
time in answering.

Beau.

On 07/09/2008, at 5:58 AM, Michael Maxwell wrote:

> 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-07 00:34:35 CEST

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