Home

Awesome

MergeVLDocs

Merging VL documents with traditional tools is hard. This tool is the first step towards an easy-to-use visual merge tool.

VL Documents

Merging patches shouldn't be harder, but easier to merge than textual code. Why?
A document is a tree of elements, where each element is identifiable via its Id (a GUID). So relating documents in different versions should be mostly about relating elements with the same Id.

Problem space

Merging is about taking the difference

Let's distinguish different cases:

First intuitions:

First approach

Let's build a small application that gets called by git merge. Let's access the different versions (Base, Local, Remote) in the same way that p4merge and other merge tools do: via command-line arguments. In this first sketch, we load the three VL documents just as an XElement structure.

In this first naive implementation, we try to come up with a solution that covers most cases... So let's just work on an XElement and XAttribute level.

There are many things to discuss and to test. But it's a start. It's obvious that this approach can mess up the patches as much as a line-based merge tool. But at least certain kinds of errors can't occur.

Goals

After merging:

Setup

For now, it is manual.

  [merge]
    tool = MergeVLDocs
  [mergetool "MergeVLDocs"]
    cmd = \"C:/Program Files/MergeVLDocs/MergeVLDocs.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
    path = C:/Program Files/MergeVLDocs/MergeVLDocs.exe

make sure the path above is correct and the executable is at the correct location. Note that the path is made of slashes, not back-slashes. (Sorry for the inconvenience)

This configures our merge tool to be called regardless of the file type. The idea here is that our tool should do its job for VL-files, but call the previously configured tool in all other cases.

Merge Tests

You can test the tool with your library or project VL docs, but that's not recommended for now. https://github.com/vvvv/MergeVLDocsExamples is here to exemplify merge problems and is here to test our tool.