Document version management with Writer?


I use LibreOffice Writer to write manuals associated with application software. Code is managed by a version control system (VCS) which efficiently stores code (through changesets) and allows to checkout any previous version.

I don’t know how to do it with LibreOffice: an .odt file is equivalent to a zip file and the VCS sees it as a binary file, so storage is not as efficient as with a text file.

Presently, I store my different versions as different .odt files with revision number embedded in the file name.
I would like to manage my versions directly from LibreOffice Writer so that all releases could be accessed easily and stored with minimal overhead. I’d like also to display the changesets between one version and another (at least one and the next one).

  • Please note this is different from “change tracking(of which I’m aware and know how to use) because I want to keep the full document history once all changes from one version to the next have been agreed upon and accepted.

Is this currently possible with Writer? If yes, how?

Thanks for the hints.

What is your VCS system? CVS, Subversion, Git, Mercurial…

At this point, it is irrelevant. VCS handle very simple files: codes files are simple sequences of characters and there is no side semantic information, such as style definition, lay-out directices, … With some word processors, spacing may be unimportant (one or more spaces between words have the same role). Consequently, deciding that a version is different from another is more complicated than just comparing the run of characters. A front-end is needed before the VCS.

I think you can use the OpenDocument text (Flat XML) .fodt, loosing the file compression.

Diff of XML files will most probably produce unusable mess, specially if documents differ more then just few changes… And also you should be very familiar with the OpenDocument XML format (how data are stored in XML files). So this will be a challenge.

Yes, there is a difference between human-relevance (probably debatable because “a man’s constant is another man’s variable”) and tecnical difference sets.

.odt file is actually a zip file which contains some XML files. For good diff you would need to unzip it and run these XML files through some XML beautifier which splits one-line xml to several lines (or google for how to make git or your VCS xml aware). To open the document again you would need to compose it before opening with LibreOffice. You could write scripts which do it for you both ways. If this if worth the hassle, depends on how important nice diffs are to you.

You might be able to extend your VCS through hooks to automatically unpack .odt files before commit and diff actions and automatically ignore the .odt itself. This either would end up really quirky and buggy or might work quite well.

Few years back I used Subversion and GUI tool was TortoiseSVN (there is also Tortoise for other CVS) and there was a plug-in for Microsoft Office documents (few years ago it was the MS-Office was the facto standard in our company). So you will need to search for some OpenDocument plugin for this tool…

Or try something like (I haven’t used this):