Use libgit2 in LibreOffice.
- When you enable version control on your document then the document becomes a git repository and every save is a commit.
- When you get someone else’s changes to the document you ‘fetch’ and ‘merge’ their new commits. The other party could do the same by merging your commits in their clone.
- Because it is a git repository it could be linked to a github repository (or local server) that people can collaborate on but also work offline when they need to.
- Track changes is a view of ‘git blame’ and the version history in a plot of the repository tree.
Why re-invent version control when ‘libgit2’ gives you an api you can bundle with you software?