You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bas Mevissen <sg...@basmevissen.nl> on 2004/04/08 08:51:59 UTC

Oddity with svn diff on moved/renamed files

Hi,

On request of Ben Sussman, I would like to document a case of strange
behaviour of the svn diff command. I've discussed this last night with Ben
on IRC.

Situation:
A working copy of a subversion archive contains some files. One of them
(parser.c) is renamed to a different name (config.c). Subversion version
from 1.0.1-1 package on Fedora Core 1, packaged by David Summers.

Log:

$ svn status
A  +   config.c
D      parser.c

$ svn diff
Index: parser.c
===================================================================
--- parser.c    (revision 768)
+++ parser.c    (working copy)
@@ -1,44 +0,0 @@
-/* parser.c - test the configuration
- *
- * $Id:$
- */
-

(real contents stripped somewhat)

I was expecting to get both the minus of parser.c and the plus of config.c
in the diff output.

Ben found out that when the status of a file is "A" (so without history),
it is shown as plus by svn diff.

I think that the behaviour of svn diff is wrong in this. So I call it a
bug. Comments welcome.

Regards,

Bas.


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

Re: Oddity with svn diff on moved/renamed files

Posted by Bas Mevissen <sg...@basmevissen.nl>.
On Saturday 10 April 2004 01:03, Greg Hudson wrote:
> 
>
> > I think that the behaviour of svn diff is wrong in this. So I call it a
> > bug. Comments welcome.
>
> Well, the behavior is deliberate.  Whether it's a bug depends somewhat
> on what you think "svn diff" should accomplish, which has always been a
> difficult question because it's trying to cram a tree delta into a
> path-based delta format.

Well, there is a certain CMS system that also has (according to the docs 
because I didn't agree with the licence to test it) the possibility to make a 
diff and that works that way.

My personal idea is that the diff should contain exactly that what differs 
between the working copy and the version you checked out.


Bas.


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

Re: Oddity with svn diff on moved/renamed files

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2004-04-08 at 04:51, Bas Mevissen wrote:
> I was expecting to get both the minus of parser.c and the plus of config.c
> in the diff output.

If you had made changes to config.c relative to what you copied it from,
you would see those changes.

> I think that the behaviour of svn diff is wrong in this. So I call it a
> bug. Comments welcome.

Well, the behavior is deliberate.  Whether it's a bug depends somewhat
on what you think "svn diff" should accomplish, which has always been a
difficult question because it's trying to cram a tree delta into a
path-based delta format.


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