Merge (revision control)

Merge (revision control)

Merging (also called integration) in revision control, is a fundamental operation that reconciles multiple changes made to a revision-controlled collection of files. Most often, it is necessary when a file is modified by two people on two different computers at the same time. When two branches are merged, the result is a single collection of files that contains both sets of changes.

In some cases, the merge can be performed automatically, because the changes do not conflict. In other cases, a person must decide exactly what the resulting files should contain. Many revision control software tools include merge capabilities.

Merge can be used as a verb ("to merge branches,") but can also be a noun ("this merge will be difficult.")

Contents

Types of Merges

There are two primary types of merges performed by automated merge tools: 2-way merge and 3-way merge. A 3-way merge is a more powerful and reliable method of merging than is afforded by the 2-way merge.

Two-way Merge

A two-way merge performs an automated difference analysis between a file 'A' and a file 'B'. This method considers the differences between the two files alone to conduct the merge and makes a "best-guess" analysis to generate the resulting merge. Consequently, this type of merge is usually the most error prone and requires user intervention to verify and sometimes correct the result of the merge prior to completing the merge event.

Three-way merge

Diagram of a three way merge
C is the Parent, A and B are derivatives of C, and D is the new output version

A three-way merge is performed after an automated difference analysis between a file 'A' and a file 'B' while also considering the origin, or parent, of both files (usually the parent is the same for both). This type of merge is more likely to be usable in revision control systems, which can guarantee that such a parent exists and is known. The merge tool examines the differences and patterns appearing in the changes between both files as well as the parent, building a relationship model to generate a merge of files 'A', 'B', and the parent 'C', to produce a new revision 'D'.

This merge is the most reliable and has performed well in practice. It has also required the least amount of user intervention, and in many cases, requiring no intervention at all (depending upon the complexity of the merge) making the process eligible for task automation.

Trends

The technological advancements in the 3-way merge method have led to the increase in popularity among software development environments to institute concurrent modification through branching in their practices of software configuration management (SCM). In the early to mid-1990s branching was a discouraged practice in smaller software development groups due to the complexities and conflicts introduced through the merging process and the low availability of cost-effective 3-way merge tools. However, this practice was more in demand among larger groups merely due to the increased likelihood that two developers would need to modify the same file at the same time. Merging, at that time, was indeed a challenge and in some environments, additional proprietary conventions were introduced to simplify the necessary merge.

In the early 2000s, the increased availability of reliable 3-way merge tools reduced the time that software development groups had to spend concerning themselves with the technical limitations of their infrastructure. Even smaller software groups are more inclined to approach concurrent modification in their revision control systems. Nevertheless, merges still often cause problems; even intelligent merge tools can't resolve all conflicts automatically. Consequently, human interaction is required, which can lead to human errors.

3-way merges still remain one of the more taxing tasks of any software development team. This is especially because the person resolving the merge needs prior knowledge of the original code, the intermediate commit and the changes wanted.

Recent developments

In recent years, some new merge algorithms have been developed and are gaining popularity:

  • the patch commutation of Darcs
  • the two-way merge with history of Codeville

Standalone merging tools

Other merge tools are cited in diff.

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Revision control — For the Wikipedia revision control system, see Wikipedia:Revision control. Example history tree of a revision controlled project. Revision control, also known as version control and source control (and an aspect of software configuration man …   Wikipedia

  • Distributed revision control — A distributed revision control system (DRCS), distributed version control or decentralized version control (DVCS) keeps track of software revisions and allows many developers to work on a given project without necessarily being connected to a… …   Wikipedia

  • Comparison of revision control software — The following is a comparison of revision control software. The following tables includes general and technical information for notable revision control and software configuration management (SCM) software. This is an incomplete list, which may… …   Wikipedia

  • Merge — See Help:Merging for the usage of Merge in Wikipedia. Contents 1 Concepts 2 Computer science 3 Music …   Wikipedia

  • Merge (Versionsverwaltung) — Dieser Artikel oder Abschnitt ist nicht hinreichend mit Belegen (Literatur, Webseiten oder Einzelnachweisen) versehen. Die fraglichen Angaben werden daher möglicherweise demnächst gelöscht. Hilf Wikipedia, indem du die Angaben recherchierst und… …   Deutsch Wikipedia

  • Merge — Beispiel eines Merge Vorgangs, der mit dem Werkzeug Meld getätigt wird (Links: Alte Dateiversion; Rechts: Neue Dateiversion). Merge [mɝːdʒ] (engl.: to merge „vereinigen, zusammenführen“) ist der Vorgang des Abgleichens mehrerer Änderungen, die an …   Deutsch Wikipedia

  • Control de versiones — Una versión, revisión o edición de un producto, es el estado en el que se encuentra dicho producto en un momento dado de su desarrollo o modificación. Se llama control de versiones a la gestión de los diversos cambios que se realizan sobre los… …   Wikipedia Español

  • Source Code Control System — (SCCS) was the first source code revision control system. It was originally developed at Bell Labs in 1972 by Marc J. Rochkind for an IBM System/370 computer running OS/MVT. It was later rewritten for UNIX, then running on a PDP 11. Subsequently …   Wikipedia

  • Version control system — Система управления версиями (от англ. Version Control System или Revision Control System)  программное обеспечение для облегчения работы с изменяющейся информацией. Система управления версиями позволяет хранить несколько версий одного и того же… …   Википедия

  • Optimistic concurrency control — In the field of relational database management systems, optimistic concurrency control (OCC) is a concurrency control method that assumes that multiple transactions can complete without affecting each other, and that therefore transactions can… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”