Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I remember a reading a while ago that CVS merge actually uses the diff3 algorithm to perform merging.</p> <p>This PDF article <a href="http://www.cis.upenn.edu/~bcpierce/papers/diff3-short.pdf" rel="nofollow noreferrer">A Formal Investigation of Diff3, by Sanjeev Khanna, Keshav Kunal, and Benjamin C. Pierce</a> from the Universtiy of Pennsylvania describes the diff3 algorithm in detail.</p> <p>If focuses primarily on the properties of the merging algorithm itself, not on how it integrates with CVS. </p> <p>In answer to your questions:</p> <h2>Tag, date awareness</h2> <p>From the CVS man page:</p> <blockquote> <p>-j tag[:date] Merge in changes from revisions specified by tag or, when date is specified and tag is a branch tag, the version from the branch tag as it existed on date</p> </blockquote> <h2>2 or 3 way and text/binary awareness</h2> <p>diff3 defaults to a plain text diff. It compares (diffs) 3 versions of the file.</p> <p>From the diff3 man page:</p> <blockquote> <p>If `diff3' thinks that any of the files it is comparing is binary (a non-text file), it normally reports an error, because such comparisons are usually not useful. As with 'diff', you can force 'diff3' to consider all files to be text files and compare them line by line by using the '-a' or '--text' options.</p> </blockquote> <h2>Base version during comparison</h2> <p>The base version, according to the linked article, is the last <em>common</em> version (O) between the two current versions of the file (A and B). It first uses the 2 way diff algorithm to find the longest common subsequences between O and A, and O and B.</p> <p>Then (quoted from the article) it:</p> <blockquote> <p>... takes the regions where O differs from either A or B and coalesces the ones that overlap, leading to the alternating sequence of stable (all replicas equal) and unstable (one or both replicas changed) chunks shown in Figure 1(c).3 Finally, it examines what has changed in each chunk and decides what changes can be propagated, as shown in Figure 1(d)—here, the second chunk is changed only in A (by inserting 4, 5), so this change can be propagated to B, but the fourth chunk has changes in both A and B, so nothing can be propagated.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload