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

Re: svn diff, svn merge, and vendor branches (long)

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-12-08 12:59:03 CET

Eric Gillespie <epg@pretzelnet.org> writes:

> > It appears that you, and Greg Hudson, believe that diff should
> > use a different algorithm for comparing files and
> > directories.
> Absolutely not. Read my earlier messages. svn diff should
> simply hand off to diff(1) in *all* cases, or at least that
> should be the effect, just like cvs.

I not sure what "diff(1) in all cases" means. All 'svn diff' output
is produced by running diff(1). When you run diff the editor receives
a delta for the files that change, it then generates two full texts
and runs diff(1) on those.

Suppose my repository looks like


where none of dir1/foo.c, dir2/foo.c and dir4/foo.c have a common

Now you want

  svn diff http://host/repo/dir1/foo.c http://host/repo/dir2/foo.c
  svn diff http://host/repo/dir1/foo.c http://host/repo/dir3/dir4/foo.c

to ignore revision history and generate direct file-to-file diff. Now
suppose I run

  svn diff http://host/repo/dir1 http://host/repo/dir2

That will produce a different diff for foo.c than that produced by the
command run on foo.c directly. I think it is "obviously" wrong for
the form of the diff to depend on the URL in this way. That's also
why I think the merge behaviour is wrong.

Or does you request for "diff(1) in all cases" mean that you want the
directory diff command to ignore revision history as well? I don't
know how that would be implemented. What about the commands

  svn diff http://host/repo/dir1 http://host/repo/dir3/dir4
  svn diff http://host/repo/dir1 http://host/repo/dir3

Would they show different diffs for foo.c?

I still believe that the current 'svn diff' is correct, and I think
that 'svn merge' is wrong to allow the merge of the diff between
arbitrary files without giving at least a warning. I think that, in
general, if you attempt to merge unrelated files you are doing
something wrong. There are perhaps some cases where it is useful, in
such cases having a --unrelated switch would be easier than running
the procedure manually, but I don't think it should be the default

Philip Martin
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 8 12:59:48 2002

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