git version control in LibreOffice

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?

I haven’t dug into this yet - I probably will if I use Libreoffice extensively - but it seems that there are some ways to get some versioning working without a major reformat

Take a look at GitHub - Nicola17/ODT-Git-helper: this python script gives you the possibility to extract/compress all files needed to keep track of your ODT files modifications into a Git repository and https://web.archive.org/web/20180107081412/https://git.wiki.kernel.org/index.php/GitTips#How_to_use_git_to_track_OpenDocument_.28OpenOffice.2C_Koffice.29_files.3F

If you have good ideas how to bring the ODF file format in its zip-kind into Git, please share it. If you can work out which changes to the ODF file format in its flat kind are necessary to get a good handling in Git, please share it. There are currently discussions in the ODF TC about that.

“the document becomes a git repository” will only be possible when changing the ODF standard. A LibreOffice user forum is the wrong place to discuss it. For contact the ODF TC start at OASIS Open Document Format for Office Applications (OpenDocument) TC | OASIS