Carsten Dominik <carsten.domi...@gmail.com> writes: > One of the obstacle for using Org-mode for collaborative programs is > that many operations add or remove text from the beginning or end of a > file, or which add or remove a subnode from an outline tree.
On of the things that I think would be necessary is a way to put an Org document into a "normalized" representation and then evaluate the differences between two of these. The generic exporter started by Bastien could probably deliver such a representation. > These are operations that confuse the git merger, in particular > if two people have added something to a file, or removed/added > sequential sibling nodes. Git merge only works reasonably well for program code (and only if there's no changelog stuff inside the file). The merge driver functionality is there to solve that problem for when you _can_ be smarter. It is absolutely not necessary to write that driver in any particular language, all that git does is to call the driver with three versions of the same file as the argument. > I believe that this could be solved with a dedicated merge driver > that understands the integrity of an outline (sub)tree, and that > knows that the sequence of two new subtrees added by different people > does not matter. You ask a potentially very big question here, this should be constrained to keep it manageable. I think a reasonable strategy is to merge two Org documents "from the outside in", that is starting with the topmost tree elements. If you are merging at the tree level, anything inside the tree should not matter at all. I'm not sure the sequence doesn't matter, but that can hardly be decided by the merge driver unless it figures out how to sort elements of a tree. The second step would then be to check the leaf nodes of the tree for concurrent changes, which probably still need to be resolved manually. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables