You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Joseph Bachir <jo...@gmail.com> on 2006/04/30 08:25:55 UTC

difference between svn and regular merge?

Greetings-

Is there any difference between how svn merges, and regular command-line
merge? I've asked some folks about this before, and the answer is usually a
vague "svn uses the file history data". I don't understand what that
means... I can't imagine what extra data a program could have about the
differences between two files. Or is the magic in the merging... does it
somehow incrementally and therefore more "carefully" do the merges into the
3rd file?

Or is there no difference at all, it's just much more convenient than
exporting each version and then performing the merge manually?

Thanks,
John

Re: difference between svn and regular merge?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Apr 30, 2006, at 10:25, John Joseph Bachir wrote:

> Is there any difference between how svn merges, and regular command- 
> line merge? I've asked some folks about this before, and the answer  
> is usually a vague "svn uses the file history data". I don't  
> understand what that means... I can't imagine what extra data a  
> program could have about the differences between two files. Or is  
> the magic in the merging... does it somehow incrementally and  
> therefore more "carefully" do the merges into the 3rd file?
>
> Or is there no difference at all, it's just much more convenient  
> than exporting each version and then performing the merge manually?

How would you manually perform a merge?

Subversion isn't doing any magic. It's exactly computing the  
difference between the two indicated repository locations (be they  
two revisions of one path, or two different paths), and applies the  
difference to the current working copy.

Note that the merge uses the difference computed by svn diff, but  
that the output produced by svn diff does not show all the  
information that the internal differencing algorithm is aware of. For  
example, svn diff will not tell you any information about  
directories, though the differencing algorithm is aware of directory  
changes too, and svn merge makes use of that.

Once you do a merge, the items in the working copy are modified.  
Subversion as of that point has no idea where the changes came from.  
It doesn't see any difference between changes that got performed as a  
result of a merge, and changes that were made by hand.

To do the merge by hand, you would have to determine by hand which  
directories and/or files might have to be added or removed or moved,  
do that, and also apply the diff of changes to existing files. I  
can't think of any reason to want to do that, though, since that's  
what svn merge is for, and it works great. And if it doesn't, then  
that's a bug. ;-)



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

Re: difference between svn and regular merge?

Posted by John Joseph Bachir <jo...@gmail.com>.
Thanks Ryan and Roel for your responses. Yes, I only meant at the file
level, i.e., using diff and patch on any given set of 3 files.

Re: difference between svn and regular merge?

Posted by Roel Schroeven <rs...@fastmail.fm>.
John Joseph Bachir schreef:

> Is there any difference between how svn merges, and regular command-line 
> merge? I've asked some folks about this before, and the answer is 
> usually a vague "svn uses the file history data". I don't understand 
> what that means... I can't imagine what extra data a program could have 
> about the differences between two files. Or is the magic in the 
> merging... does it somehow incrementally and therefore more "carefully" 
> do the merges into the 3rd file?

I think the difference is mostly in keeping track of changes to trees: 
renames, additions of files, removal of files. I don't think there's any 
difference of you're just merging the changes in a file.

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven


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