Elektra  0.9.4
kdb-cmerge(1) -- Three-way merge of KeySets

kdb-cmerge - Join three key sets together

kdb cmerge [OPTIONS] our their base result

kdb cmerge can incorporate changes from two modified versions (our and their) into a common preceding version (base) of a key set. This lets you merge the sets of changes represented by the two newer key sets. This is called a three-way merge between key sets.
On success the resulting keyset will be saved to mergepath.
On unresolved conflicts nothing will be changed.
This tool currently exists alongside kdb merge until it is completely ready to supersede it. At this moment, cmerge will be renamed to merge.

The options of kdb cmerge are:

Strategies offer fine grained control over conflict handling. The option is:

Strategies have their own man page which can be accessed with man elektra-cmerge-strategies.

The result of the merge is stored in result.

You can think of the three-way merge as subtracting base from their and adding the result to our, or as merging into our the changes that would turn base into their. Thus, it behaves exactly as the GNU diff3 tool. These three versions of the KeySet are:

The three-way merge works by comparing the our KeySet and the their KeySet to the base KeySet. By looking for differences in these KeySets, a new KeySet called result is created that represents a merge of these KeySets.

Conflicts occur when a key has a different value in all three key sets or when only base differs. When all three values for a key differ, we call this an overlap. Different merge strategies exist to resolve those conflicts.

To complete a simple merge of three KeySets:

````ssh kdb set user:/base "A" #> Create a new key user:/base with string "A" kdb set user:/their "A" #> Create a new key user:/their with string "A" kdb set user:/our "B" #> Create a new key user:/our with string "B" kdb cmerge user:/our user:/their user:/base user:/result kdb get user:/result #>B

```