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

RE: Inconsistency between diff and svn diff

From: Giulio Troccoli <giulio.troccoli_at_uk.linedata.com>
Date: Tue, 29 Sep 2009 12:11:01 +0100

>

Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447

-----Original Message-----

> From: Stefan Sperling [mailto:stsp_at_elego.de]
> Sent: 29 September 2009 11:58
> To: Giulio Troccoli
> Cc: users_at_subversion.tigris.org
> Subject: Re: Inconsistency between diff and svn diff
>
> On Tue, Sep 29, 2009 at 10:18:36AM +0100, Giulio Troccoli wrote:
> > I came across this problem while using ViewVC, but I don't
> think it's a problem with ViewVC, and it mihgt not even be a
> problem with Subversion. It's just that I have different
> results using diff and svn diff and I don't understand why.
> >
> > I have a text file, with the svn:mime-type property set to
> text/plain, which unfortutanely does not have a newline at
> the end (and maybe this is the problem).
> >
> > Running the svn diff command
> >
> > svn diff -c5867 http://<path>/zdiacb10.rwt
> >
> > gives me the differences but ends with the message
> >
> > \ No newline at end of file
> >
> > (yes, with a heading \)
> >
> > I have also use the svn cat command twice to get the file
> at revision
> > 5866 and 5867 and the used the diff command like this
> >
> > svn cat -r5866 http://<path>/zdiacb10.rwt > gt1 svn cat -r5867
> > http://<path>/zdiacb10.rwt > gt2 diff gt1 gt2
> >
> > But the result was
> >
> > Binary files gt1 and gt2 differ
> >
> > Is it because of the missing newline at the end that diff
> thinks these are binay files? And is it because the
> svn:mime-type property is set that svn is able to actually
> give the differences?
>
> Sounds like there are characters in those files which aren't
> considered printable (e.g. by isprint()) in your currently
> configured locale.
> So diff thinks the file is binary, but you told svn to treat
> it as text/plain anyways so it works there.
>
> Try passing the -a flag to diff:
>
> -a Treat all files as ASCII text. Normally
> diff will simply print
> ``Binary files ... differ'' if files contain
> binary characters.
> Use of this option forces diff to produce a diff.
>

Thanks Stefan. I had already tried with the -a option, only forgot to tell you :-)

Anyway, the result is exactly as for svn diff, it shows me the differences and ends with "\ No newline at end of file". However, diff also show a lot of non printable characters at the end

137d133
< ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
\ No newline at end of file

which I presume it's becuase on the missing newline at the end?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2401583

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-29 13:12:45 CEST

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

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