You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Michael Sinz <Mi...@sinz.org> on 2005/10/10 16:38:50 UTC

svn diff output confusion?

The following command (yes, the repository is open to the public for read access)
produces a rather strange svn diff result:

# svn diff --notice-ancestry -r 16:30 http://svn.code-host.net/svn/example/trunk/tests/TestCase-mv@30
Index: file-1.txt
===================================================================
--- file-1.txt  (revision 16)
+++ file-1.txt  (revision 30)
@@ -1 +0,0 @@
-Thu Oct  6 07:35:07 EDT 2005
Index: file-1.txt
===================================================================
--- file-1.txt  (revision 0)
+++ file-1.txt  (revision 30)
@@ -0,0 +1,3 @@
+Mon Oct 10 12:02:47 EDT 2005
+Mon Oct 10 12:04:16 EDT 2005
+Mon Oct 10 12:05:15 EDT 2005

Property changes on: file-1.txt
___________________________________________________________________
Name: svn:eol-style
    + native
Name: svn:keywords
    + Id

Index: file-2.txt
===================================================================
--- file-2.txt  (revision 16)
+++ file-2.txt  (revision 30)
@@ -1 +0,0 @@
-Thu Oct  6 07:35:09 EDT 2005
Index: file-2.txt
===================================================================
--- file-2.txt  (revision 0)
+++ file-2.txt  (revision 30)
@@ -0,0 +1 @@
+Mon Oct 10 12:03:50 EDT 2005

Property changes on: file-2.txt
___________________________________________________________________
Name: svn:eol-style
    + native
Name: svn:keywords
    + Id

Index: file-3.txt
===================================================================
--- file-3.txt  (revision 16)
+++ file-3.txt  (revision 30)
@@ -1 +1 @@
-Thu Oct  6 07:35:11 EDT 2005
+Mon Oct 10 12:03:19 EDT 2005
------------------------------------------------------------------------------

Note #1:  the double listing of file-1.txt and file-2.txt.

Note #2:  file-3.txt also has props set on it yet they are not shown
           I believe this is due to the face the file-3.txt is not
           double listed.

Note #3:  this does not happen if I don't include the "--notice-ancestry"
           option.

Since this is a production server, it is running svn 1.2.3 (not trunk) and
the command line is also svn 1.2.3

Feel free to browse the repository at:

	http://svn.code-host.net/svn/example/trunk/tests/TestCase-mv/

Note that I am using a peg revision for svn diff the URL just in case that
example repository changes again (I put in test cases that have caused
problems in the Insurrection user interface into this repository)

-- 
Michael Sinz                     Technology and Engineering Director/Consultant
"Starting Startups"                                mailto:michael.sinz@sinz.org
My place on the web                            http://www.sinz.org/Michael.Sinz

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

Re: svn diff output confusion?

Posted by Michael Sinz <Mi...@sinz.org>.
Greg Hudson wrote:
> On Mon, 2005-10-10 at 12:38 -0400, Michael Sinz wrote:
> 
>>Note #1:  the double listing of file-1.txt and file-2.txt.
> 
> 
> A file-deletion followed by a file-add.  What's so strange about that?

Well, it was just a set of renames.  That is why I thought it was
strange.

So, the reason for this is because of the diff being done on a directory
and it shows all of the changes due to the files being physically
different.  (file-1.txt in r16 becomes file-5.txt and then file-2.txt)

But if I do a diff on each of the individual files in the directory
the results are different - for example:

svn diff --notice-ancestry -r 16:30 http://svn.code-host.net/svn/example/trunk/tests/TestCase-mv/file-1.txt@30

Index: file-2.txt
===================================================================
--- file-2.txt  (.../file-2.txt)        (revision 16)
+++ file-2.txt  (.../file-1.txt)        (revision 30)
@@ -1 +1,3 @@
-Thu Oct  6 07:35:09 EDT 2005
+Mon Oct 10 12:02:47 EDT 2005
+Mon Oct 10 12:04:16 EDT 2005
+Mon Oct 10 12:05:15 EDT 2005
------------------------------------------------------------------------

Note that it says that the diff is for file-2.txt (which is acceptable
since it is file-2.txt that becomes file-1.txt at the end)

So, the question is why the difference in output when doing the directory
diff rather than the file diff?

Maybe this really belongs in users, but given the talk about diff behaviors,
I thought I would bring this up.

>>Note #3:  this does not happen if I don't include the "--notice-ancestry"
>>           option.
> 
> Well, yes; without the --notice-ancestry flag, we treat the same
> situation as a file modification because the unrelated files have the
> same pathname.  That's what the flag is for.

Ahh, but it does not say that there was a file change in the output
(unlike the file diff that does show the name changes)

-- 
Michael Sinz                     Technology and Engineering Director/Consultant
"Starting Startups"                                mailto:michael.sinz@sinz.org
My place on the web                            http://www.sinz.org/Michael.Sinz

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

Re: svn diff output confusion?

Posted by Greg Hudson <gh...@MIT.EDU>.
On Mon, 2005-10-10 at 12:38 -0400, Michael Sinz wrote:
> Note #1:  the double listing of file-1.txt and file-2.txt.

A file-deletion followed by a file-add.  What's so strange about that?

> Note #3:  this does not happen if I don't include the "--notice-ancestry"
>            option.

Well, yes; without the --notice-ancestry flag, we treat the same
situation as a file modification because the unrelated files have the
same pathname.  That's what the flag is for.


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