Skip to content

Instantly share code, notes, and snippets.

View c-mauderer's full-sized avatar

Christian Mauderer c-mauderer

View GitHub Profile
@c-mauderer
c-mauderer / odt2txt.cmd.md
Created January 17, 2023 15:47 — forked from bradkrane/odt2txt.cmd.md
Git diff for LibreOffice ODT files for Windows Setup

Batch Script and Git Setup for text diff of ODT files with LibreOffice

git Windows will diff docx files without any additional configuration but surprisingly, this is not the case for ODT files. This simple Window shell script and git attributes configuration allows for diffing ODT files with LibreOffice

Windows Shell Script

Copy the script below locally, I use %USERPROFILE%\scripts as the reference destination in the Configure Git section below, but you can choose whatever you want replacing the path with your own throughout the document.

Waring: this script assumes that the there is no .txt file that matches the filename less extension of the ODT file being diffed. This is a temporary work around for the --cat option of soffice.exe not working as advertized. Bug 129713