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

Re: svnlook diff fails on binary files:

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-11-09 20:39:18 CET

Blair Zajac <blair@orcaware.com> writes:

> > $ diff -v
> > diff - GNU diffutils version 2.7
> > $ diff /bin/rm /bin/mv
> > Binary files /bin/rm and /bin/mv differ
> > $ echo $?
> > 1
> > $ diff /bin/rm /bin/rm
> > $ echo $?
> > 0
>
> Diff 2.8.1 does it differently.
>
> % diff -v
> diff (GNU diffutils) 2.8.1
> % diff /bin/rm /bin/mv
> Binary files /bin/rm and /bin/mv differ
> % echo $?
> 2
> % diff /bin/rm /bin/rm
> % echo $?
> 0

This makes diff 2.8.1 very hard to use on text files :-(

The change is not documented in the NEWS/man/info files as far as I
can tell, it's hidden away in this cryptic changelog

   2002-02-28 Paul Eggert <eggert@twinsun.com>
        (Binary): Differing binary files are trouble unless the user asked for
        brief output.

where "trouble" is a reference to the use of that word in the return
value documentation. One is obviously expected to be able to recall
the GNU info pages word-for-word!

This means that for diff 2.8.1 the only way to tell whether

      'diff foo bar'

failed due to a write error is to examine the output text, text which
Subversion has directed straight to stdout. (Well there is another
way but one has to know which algorithm diff uses to determine whether
a file is binary.)

Changing Subversion to avoid running diff on binary files will solve
most problems, leaving only the case where Subversion classifies a
file as text and diff classifies it as binary. However such a case
will probably cause problems when attempting a three-way merge during
update, so the user is advised to make sure Subversion's file
classification matches that of diff.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 9 20:40:00 2002

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.