Re: Type-specific diff & patch
Thomas Lord <[email protected]>
| Newsgroups | gmane.comp.version-control.arch.user |
|---|---|
| Message-ID | <[email protected]> |
Ludovic Courtès wrote: > Perhaps this is also related to the so-called "target > market" question (e.g., "Do we care about OpenOffice.org documents?"). > I recently read that this kind of thing could be done quite easily in > Darcs [0], which might be another source of motivation for some people. > ;-) > > [....] > [0] "Towards XML Version Control of Office Documents", > http://www2-data.informatik.unibw-muenchen.de/People/borghoff/pspapers/doceng2005.pdf . > > That seems like an interesting paper. I think we might very well be interested in more or less generic XML diff/patch but I would think that would be more for web developers than OpenOffice users. There are problems with using straight XML diff/patch on OpenOffice documents: 1) The results don't necessarily display reasonably. 2) There aren't good graphical tools for resolving merge conflicts. 3) There aren't good graphical tools for looking at diffs. 4) Most importantly: it's the wrong model from the user perspective. By (4) I mean that users are normally oblivious to the tree-structured nature of content. The editing model encourages this obliviousness by hiding the tree-structured nature. The user's cognitive model seems to me to be closer to "characters with individual properties". For example, a word that is made bold-faced doesn't act like a subtree with a bold tag. It acts like a bunch of adjacent characters, each of which has the attribute of being bold. Maybe, instead of an XML diff/patch, office documents should use an algorithm that works on flat texts made up of very fat characters. In imprecise patching, such a tool should follow the same "sticky property" rules that apply to editing by hand. For example, suppose a patch says that the word "foo" is replaced by "foobar". In ORIG and MOD "foo" and "foobar" are plain-text. But in the file we're patching, "foo" happens to be bold. Well, in interactive editing, if you insert next to bold text the result is bold. So, after patching, "foobar" should be all bold text. (Handling tables, images, diagrams, etc.... is another question entirely.) -t