Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I save a file in OpenOffice so that it is not a binary file in Subversion?

I'm working on an Open Office document with a partner and we are using subversion to collaborate on it. However, we are saving the document as a .odt file and subversion reads this as a binary file type. Therefore it has me worrying that when we go to merge the files and the diff pops up that we will not be able to adequately perform the merges if there are conflicts; we won't be able to understand the raw .odt file.

So my question is "How do I save a document in Open Office so that it retains all of the formatting you would expect and want but does save as a binary file and therefore can be easily merged?"

Or am I using the wrong method to do this? (Which is more than likely)

like image 854
Robert Massaioli Avatar asked Apr 24 '09 04:04

Robert Massaioli


4 Answers

As much as you might hate it, LaTeX provides you a means to create documents, but maintain them in subversion as text, which is easily merged.

Aside from LaTeX or just keeping txt documents, setting a Lock on the file with Subversion is your best bet.

like image 197
geowa4 Avatar answered Oct 21 '22 18:10

geowa4


For complex binary file formats (of which .odt is one), I have found that it is a good idea to use locking in Subversion and not try to merge changes. Set the Subversion property svn:needs-lock on the file and you will then be required to request a lock on the file before you edit it (see Locking in the Subversion book for more details). This has worked well in my situation but it depends on your level of collaboration whether it will work well for you.

like image 7
Greg Hewgill Avatar answered Oct 21 '22 17:10

Greg Hewgill


A file doesn't have to be a text format to be diffed and merged—as long as the vendor provides a good diff and merge tool. And as long as the VCS can be configured to use these external diff/merge tools. However it's rare to have such diff and merge tools provided for proprietary doc formats.

TortoiseSVN can diff Word docs and that's extremely handy. It can apparently merge too, although I've never tried that. I think it may be able to diff and merge OpenOffice docs, but I've never tried it.

TortoiseSVN can "sort of" diff Excel docs, but it's not very nice to use. No merging.

At my company, we set svn:needs-lock on Word and Excel docs to avoid merge troubles. Even then I find it very handy to be able to diff previous revisions and see what changed.

like image 6
Craig McQueen Avatar answered Oct 21 '22 17:10

Craig McQueen


The .odt files are AFAIK zipped XML files. However even if you would save them as unzipped XML I seriously doubt that you could do merges of anything but the smallest changes.

like image 4
lothar Avatar answered Oct 21 '22 19:10

lothar