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

Re: SVN diff happens on server side or client side?

From: Ben Collins-Sussman <sussman_at_red-bean.com>
Date: 2007-07-18 12:52:39 CEST

Subversion *never* computes a contextual diff server-side. Ever.
Even if you run 'svn diff -rX:Y fileURL', the client fetches both
files to a tmp area, and then runs either an external diff binary on
them, or uses its own internal diff library.

Note this isn't as bad as it seems: when it fetches the two files,
the first one comes down compressed, the second one usually comes down
as a binary-diff against the first one. The two files are then
'decompressed' from binary-diff into normal text.

The reason we don't do server-side diffs is that it would simply be
too compute-intensive on the server. It would be a nice way to DoS.
:-) (CVS is different, because RCS files actually store contextual
line-based diffs, rather than binary diffs, so it's actually pretty
easy and low-impact for the server itself to generate the unidiff.)

On 7/18/07, Charles Acknin <charlesacknin@gmail.com> wrote:
> On 7/18/07, Shawn Jin <shawnemails@gmail.com> wrote:
> > Hi all,
> >
> > A little confused here: where does "diff" happen, server side or client
> > side? Since subversion allows user to use external diff, it appears to be
> > using client-side diff. But if diff from two revisions in the repository it
> > seems to be certain to be happening server-side.
> >
> > What happens when using external diff on two revisions of a file in the
> > repository?
>
> External diff, assuming you're talking about svn diff --diff-cmd, is
> taking place client-side. That is, the server doesn't know you're
> using an external tool to output diff on your client. However, when
> comparing two revisions of a file in a repository, the client talks to
> the server using one of the RA protocol Subversion supports.
>
> Here's how it works:
> - whatever external diff tool you want Subversion to use, 'svn diff
> -rX:Y URL' requests the server for diff information.
> - when the client receives this information, it then looks at how you
> expect Subversion to display diff. This is when your external diff
> tool is called. If no external tool was specified, Subversion will
> use its internal diff library.
>
> Cheers,
> Charles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 18 12:51:46 2007

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.