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

Re: svn diff interface

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2002-05-10 08:09:20 CEST

Here's a radical idea, which gets us back to just one uber-use-case:

  svn diff --old=[OLDTARGET][@OLDREV] --new=[NEWTARGET][@NEWREV] [path ... ]

  OLDTARGET and NEWTARGET default to "."
  OLDREV defaults to "base"
  NEWREV defaults to "current"

Revision values of "base" and "current" are equivalent to "head" when
applied to a URL; when applied to a WC path, they refer to the
checked-out revision (the text-base) and the current contents of the
WC, respectively. We don't necessarily need the user to be able to
specify "base" and "current"; we just need those concepts for the

If paths are specified in the "[path ...]" part, they prune the diff
to those paths. You can't specify URLs here, or paths beginning with


  Diff current wc dir, current against base:
    svn diff

  Diff three particular paths under current wc dir, current against base:
    svn diff foo bar baz

  Diff current wc dir against a URL:
    svn diff --old=http://whatever

  Diff current wc dir against a sibling dir:
    svn diff --old=../something

  Diff between two URLs:
    svn diff --old=http://whatever --new=http://whatever-else

  What changed in sshconnect.c and sshd.c between ssh and openssh?
    svn diff --old=http://.../ssh --new=http://.../openssh sshconnect.c sshd.c

  Diff between rev 3 and 4 of two particular paths under current wc dir:
    svn diff --old=@3 --new=@4 foo bar

  Diff between rev 3 and 4 of a URL:
    svn diff --old=http://whatever@3 --new=http://whatever@4

The last two examples seem pretty clunky. I don't know if this
interface can be tweaked to make that easier. Defaulting NEWTARGET to
OLDTARGET (instead of ".") makes the last case simpler but screws up
some of the earlier ones.

Anyway, just an idea. I'm still happy with either the "smart" or
"dumb" proposals I made earlier, and Phillip makes a reasonable case
that "svn diff" should perhaps be consistent with "svn merge" even if
that requires xargs contortions to handle the iterative case.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 10 08:16:03 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.