git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org
Subject: Git and OpenDocument (OpenOffice.org) files
Date: Mon, 27 Aug 2007 11:52:22 +0200	[thread overview]
Message-ID: <vpqk5rh5mp5.fsf@bauges.imag.fr> (raw)

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}

             reply	other threads:[~2007-08-27  9:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-27  9:52 Matthieu Moy [this message]
2007-08-27 10:08 ` Git and OpenDocument (OpenOffice.org) files 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqk5rh5mp5.fsf@bauges.imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).