git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git and OpenDocument (OpenOffice.org) files
@ 2007-08-27  9:52 Matthieu Moy
  2007-08-27 10:08 ` Junio C Hamano
  2007-08-27 10:17 ` Johannes Schindelin
  0 siblings, 2 replies; 12+ messages in thread
From: Matthieu Moy @ 2007-08-27  9:52 UTC (permalink / raw)
  To: git

Hi,

I found a way to use git comfortably with OpenDocument files (that is,
what OpenOffice.org and Koffice produce. Text, Presentations and
Spreadsheets).

Briefly, you have to install odf2txt ( http://stosberg.net/odt2txt/ )
and the script below, together with GIT_EXTERNAL_DIFF and/or diff
drivers in .gitattributes. That give you the text diff you're used to.

Everything is documented here:

  http://www-verimag.imag.fr/~moy/opendocument/

Remarks are welcome (I'll post some remarks about Git's custom diff
driver in a separate thread).


Script available from
http://www-verimag.imag.fr/~moy/opendocument/git-oodiff and reproduced
here :

#! /bin/sh

# Script acceptable as a value for GIT_EXTERNAL_DIFF.
# For example, you can see the changes in your working tree with
# 
# $ GIT_EXTERNAL_DIFF=git-oodiff diff

echo $0 "$@"

if odt2txt "$2"  > /tmp/oodiff.$$.1  && \
    odt2txt "$5" > /tmp/oodiff.$$.2 ; then
    if diff -L "a/$1" -L "b/$1" -u /tmp/oodiff.$$.{1,2}; then
        # no text change
        if diff -q "$2" "$5"; then
            : # no change at all
        else
            echo "OpenDocument files a/$1 and b/$1 files differ (same text content)"
        fi
    fi
else
    # conversion failed. Fall back to plain diff.
    diff -L "a/$1" -L "b/$1" -u "$2" "$5"
fi

rm -f /tmp/oodiff.$$.{1,2}

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-08-27 15:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-27  9:52 Git and OpenDocument (OpenOffice.org) files Matthieu Moy
2007-08-27 10:08 ` Junio C Hamano
2007-08-27 12:35   ` Matthieu Moy
2007-08-27 13:03     ` Mike Hommey
2007-08-27 13:41       ` Johannes Schindelin
2007-08-27 13:58         ` David Kastrup
2007-08-27 14:06           ` Matthieu Moy
2007-08-27 14:15             ` Johannes Schindelin
2007-08-27 14:16           ` Mike Hommey
2007-08-27 15:16             ` Sergio Callegari
     [not found]           ` <?= =?ISO-8859-1?Q?200708271416=0400.?= =?ISO-8859-1?Q?GA11000@glandium?= =?ISO-8859-1?Q?.org>
2007-08-27 15:05             ` David Kastrup
2007-08-27 10:17 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).