I’ve never tried this, so take it with a heap of salt, but you might have better luck with the diffing if you developed a process that unzipped the file contents into your repo after you’re done editing it, and then zipped the contents back up with the right extension when you want to edit it again.
Alternatively, you could just switch to a text-based format like rtf, as long as you don’t need any specific features from odt or docx.
(EDIT: someone else mentions a promising sounding “flat xml” format, which I’ve never encountered before.)
I have a current project where one of the other developers has tried this. It might work for a solo project, but with multiple developers on Windows (Excel) and Linux (Open Office), I find that Open Office feels a need to continually fuck with unrelated fields. Editing a single field in an xslx file results in changes in a dozen files in the unpacked version. Making any more complicated changes results in a diff that's impossible to manage.
Still, interesting to hear some feedback on how well (or not) that idea has worked for some.
The Flat XML option seems to be the best approach if you need to edit documents more complex than what can be represented in either markdown or rtf (rich text format).
$ ls -hl todo.fodt
-rw-rw-r-- 1 dotancohen dotancohen 150K Apr 7 16:41 todo.fodt
$ ls -hl todo.odt
-rwxrwxr-x 1 dotancohen dotancohen 117K Apr 6 12:01 todo.odt
$ wc -l todo.fodt
1983 todo.fodt
$ cp todo.fodt todo-edit-one-line.fodt
$ libreoffice todo-edit-one-line.fodt
$ diff todo.fodt todo-2.fodt | grep "+ " | wc -l
19However SQLite stores multiple files on disk for crash persistence, complicating matters. But then again so does Audacity 2, and Microsoft Office to an extent (file locking rather than data integrity).
Microsoft Word used to only append changes to the document on save rather than rewriting the whole file, but this was disabled since if you deleted text and saved the file, it remained in the document. https://www.cnet.com/culture/microsoft-disabling-word-2003s-...