Minor improvement to svn diff and missing merge information in SVN book (for Subversion 1.3)

Ben Collins-Sussman sussman at red-bean.com
Sun Nov 26 07:07:43 CST 2006

On 11/25/06, Jens Seidel <jensseidel at users.sf.net> wrote:
> Hi,
> http://svnbook.red-bean.com/nightly/en/svn-book.html contains:
> <quote>
> There's no way to represent changes to trees, such as the addition,
> removal, or renaming of files and directories. If Sally's change had,
> say, added a new directory, the output of svn diff wouldn't have
> mentioned it at all. svn diff only outputs the limited patch-format, so
> there are some ideas it simply can't express.
> </quote>
> Please note that only empty directories are not listed. I first assumed
> you mean that svn diff ignores added or deleted files in new directories ...

I think we meant to say that the traditional patch format is awkward:
showing 'all lines added' or 'all lines deleted' is a clumsy way to
show that a new file was created or deleted.  It's ambiguous at best:
does 'all lines deleted' mean the file was removed, or simply became
an empty file?  Also, there are no ways to explicitly say that a
directory was added, other than the fact that it magically shows up in
some longer path.  And so on.

> I also miss an important information related to merge operations.
> How does merge operate on copied or moved files? I assume that merge
> just applies a new copy or move operation and not a content diff but
> this is not described in the book! Example
> Assume the following files exist with common anchestry but are not
> equal.
> trunk/file
> branch/file
> Now merge a copy operation from trunk
> svn cp trunk/file trunk/copy
> (revision X)
> to branch:
> svn merge -r X-1:X trunk
> Will branch/file be equal to branch/copy or will
> trunk/copy be equal to branch/copy?

A copy operation is just an addition of a file which tracks its
source.  So in your example, a new file will be added to the branch
which is an exact copy of trunk/file.

More information about the svnbook-dev mailing list