Change history for a document in a git repository

asked 2019-07-05 13:12:05 +0200

stanton gravatar image

In Writer and Calc, if a document has been edited without change tracking enabled, but I have both the old and the new version, I can compare the document as follows:

  • Open the newest version.
  • From the menu, choose Edit > Track Changes > Compare Document… and select the previous version.
  • To compare more than two versions, repeat the previous step for each old version, going from newest to oldest.

This will give me a document with all changes over the versions highlighted.

Now suppose I have a document tracked in a git repository: every time someone makes changes to the document, they commit them. I am aware one could save the document in FOD* format, resulting in a flat-file XML document which can be viewed with the usual diff tools, but that does not work well with all types of content (think spreadsheets or text documents with tables or images).

I could extract both versions from git and use Compare Document as above, which would give me a version-tracked document, but that requires a lot of manual steps.

Is there a convenient way to compare two different versions of a document tracked in a git repository, with a Compare Document-like UX?

edit retag flag offensive close merge delete


This comment only to be notified automatically of answers

Presently, I don't commit my "long-term" documents to git because git sees the zipped .odt as an unknown binary. The .fodt trick won't give me the visibility I'm looking for. There are two aspects in change tracking:

  • following bare content evolution
  • tracking formatting adjustments

Both are intermixed in XML and a "dumb" tool like diff will not separate levels because it can't make any difference between markup (styling) and wording. As an editor, I need to consider these abstract levels at different times in the process of reviewing copy.

To illustrate the difficulty, consider an image where a single pixel was modified. I don't care for the pixel itself, what is important to me is the fact the the image, as a whole, is no longer the same.

ajlittoz gravatar imageajlittoz ( 2019-07-05 14:35:07 +0200 )edit