You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2002/05/07 02:35:53 UTC

svn diff interface

I feel pretty bad for bringing this up so late, especially since Ben
just said he's tired of talking about it, but I think I'd feel worse
bringing it up after 1.0, or letting someone else notice it.  I wasn't
really able to formulate this thought when Ben first proposed the
revised "svn diff" interface.

Basically, I think our "svn diff" interface is too limited if it
doesn't provide a way to diff the working directory against an
arbitrary URL, as currently seems to be the case.

For example, if I am merging changes between .../emacs-21 and
.../emacs-20 into .../emacs-locally-modified, I will likely want to
look at the diffs between /emacs-21 and the current working copy
before I commit, to make sure that the right set of local mods are
reflected by my merge results.

The current syntax only allows diffs between stuff which has already
been checked in.

I can see a few options here:

  1. Stick with what we have.  Require people to go through
     contortions for the use case I mentioned.

  2. Phillip Martin's suggestion, where "svn diff" takes either one or
     two arguments (instead of N arguments or two arguments).

  3. Split "svn diff" into two commands, or require an explicit flag
     in one of the two use cases.

I don't like (1) because I feel like some day there will be enough
momentum to make developers want to correct the problem, and if we
don't fix it now we'll end up stuck with a user interface which
screams "historical."  I don't like (2) because it's not very
consistent with CVS.  I don't like (3) very much because I can't think
of a specific way to make it elegant, but it is probably the cleanest
answer overall.

The fundamental problem is that "cvs diff" works very differently from
regular old "diff", and in Subversion we want to be able to support
both usages.  The "cvs diff" usage makes sense for comparisons on a
single branch, while the "diff" usage makes sense for comparisons
between branches.  It isn't always possible to determine by looking at
the arguments alone which usage is desired.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff interface

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Mon, May 06, 2002 at 10:57:58PM -0400, Greg Hudson wrote:
> On Mon, 2002-05-06 at 22:48, Garrett Rooney wrote:
> > >   2. Phillip Martin's suggestion, where "svn diff" takes either one or
> > >      two arguments (instead of N arguments or two arguments).
> 
> > personally, (2) seems the most intuitive to me, but i haven't done a
> > ton of work with cvs.  what makes this syntax inconsistent with cvs?
> 
> In CVS, I can make a bunch of mods in a directory, do "cvs diff path1
> path2", and see the mods I made to path1 and path2 in particular.  I do
> this all the time.  I could "echo path1 path2 | xargs -n1 svn diff", of
> course; it's just harder.
> 
> It's not just inconsistent but potentially surprising.  Under Phillip's
> suggestion, "svn diff path1 path2" would diff path2 against path1,
> producing a successful result which is totally different from what a CVS
> user would expect.
> 
> > and even if it is, would this be nice enough to break that
> > compatability?  personally, i'd lean towards yes, since being able to
> > say 'svn diff http://svn.collab.net/branches/my_cool_branch' and
> > having it diff my_cool_branch with my working copy would be really
> > nice...
> 
> "svn diff http:whatever .", you mean.  Under option 2, "svn diff" with
> one argument would continue to behave as it does now.

ahh, ok, i see the problem.  i'm not sure how to solve it mind you,
but i see the problem ;-)

perhaps making some distinction between the one path form when the
path is a url and when it isn't?  if it is a url, and the -r foo:bar 
hasn't been given, then compare that url at the current rev against 
the current directory.  if the -r has been given, then it works as it 
does now, whether it's a url or a path. 

just thinking out loud here...

-garrett

-- 
garrett rooney                    Remember, any design flaw you're 
rooneg@electricjellyfish.net      sufficiently snide about becomes  
http://electricjellyfish.net/     a feature.       -- Dan Sugalski

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff interface

Posted by Philip Martin <ph...@codematters.co.uk>.
Greg Hudson <gh...@MIT.EDU> writes:

> On Mon, 2002-05-06 at 22:48, Garrett Rooney wrote:
> > >   2. Phillip Martin's suggestion, where "svn diff" takes either one or
> > >      two arguments (instead of N arguments or two arguments).
> 
> > personally, (2) seems the most intuitive to me, but i haven't done a
> > ton of work with cvs.  what makes this syntax inconsistent with cvs?
> 
> In CVS, I can make a bunch of mods in a directory, do "cvs diff path1
> path2", and see the mods I made to path1 and path2 in particular.  I do
> this all the time.  I could "echo path1 path2 | xargs -n1 svn diff", of
> course; it's just harder.
> 
> It's not just inconsistent but potentially surprising.  Under Phillip's
> suggestion, "svn diff path1 path2" would diff path2 against path1,
> producing a successful result which is totally different from what a CVS
> user would expect.

Yes, it's different, is that a big problem?  I don't use CVS a great
deal, but when I run 'svn diff' it is usually with zero or one
arguments. When I use two arguments, comparing the two arguments
against each other is usually what I *want*.

Is having the 'svn diff TARGET1 TARGET2' behaviour depend on the exact
form of the targets a good interface?  I would much prefer consistency
with 'svn merge' than with CVS.

-- 
Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff interface

Posted by Greg Hudson <gh...@MIT.EDU>.
On Mon, 2002-05-06 at 22:48, Garrett Rooney wrote:
> >   2. Phillip Martin's suggestion, where "svn diff" takes either one or
> >      two arguments (instead of N arguments or two arguments).

> personally, (2) seems the most intuitive to me, but i haven't done a
> ton of work with cvs.  what makes this syntax inconsistent with cvs?

In CVS, I can make a bunch of mods in a directory, do "cvs diff path1
path2", and see the mods I made to path1 and path2 in particular.  I do
this all the time.  I could "echo path1 path2 | xargs -n1 svn diff", of
course; it's just harder.

It's not just inconsistent but potentially surprising.  Under Phillip's
suggestion, "svn diff path1 path2" would diff path2 against path1,
producing a successful result which is totally different from what a CVS
user would expect.

> and even if it is, would this be nice enough to break that
> compatability?  personally, i'd lean towards yes, since being able to
> say 'svn diff http://svn.collab.net/branches/my_cool_branch' and
> having it diff my_cool_branch with my working copy would be really
> nice...

"svn diff http:whatever .", you mean.  Under option 2, "svn diff" with
one argument would continue to behave as it does now.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn diff interface

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Mon, May 06, 2002 at 10:35:53PM -0400, Greg Hudson wrote:
> I can see a few options here:
> 
>   1. Stick with what we have.  Require people to go through
>      contortions for the use case I mentioned.
> 
>   2. Phillip Martin's suggestion, where "svn diff" takes either one or
>      two arguments (instead of N arguments or two arguments).
> 
>   3. Split "svn diff" into two commands, or require an explicit flag
>      in one of the two use cases.
> 
> I don't like (1) because I feel like some day there will be enough
> momentum to make developers want to correct the problem, and if we
> don't fix it now we'll end up stuck with a user interface which
> screams "historical."  I don't like (2) because it's not very
> consistent with CVS.  I don't like (3) very much because I can't think
> of a specific way to make it elegant, but it is probably the cleanest
> answer overall.

personally, (2) seems the most intuitive to me, but i haven't done a
ton of work with cvs.  what makes this syntax inconsistent with cvs?
and even if it is, would this be nice enough to break that
compatability?  personally, i'd lean towards yes, since being able to
say 'svn diff http://svn.collab.net/branches/my_cool_branch' and
having it diff my_cool_branch with my working copy would be really
nice...

-garrett 

-- 
garrett rooney                    Remember, any design flaw you're 
rooneg@electricjellyfish.net      sufficiently snide about becomes  
http://electricjellyfish.net/     a feature.       -- Dan Sugalski

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org