From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Git and OpenDocument (OpenOffice.org) files
Date: Mon, 27 Aug 2007 14:35:14 +0200 [thread overview]
Message-ID: <vpqtzql17gd.fsf@bauges.imag.fr> (raw)
In-Reply-To: <7vps19jnm1.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Mon\, 27 Aug 2007 03\:08\:54 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> Remarks are welcome (I'll post some remarks about Git's custom diff
>> driver in a separate thread).
>
> Good.
>
> I think creation/deletion will get /dev/null as the temporary
> file name, so as long as odt2txt knows how to deal with
> /dev/null you would not have to worry much about them.
But odt2txt doesn't know how to deal with /dev/null. New version of
git-oodiff that manages it correctly online and below.
> You might want to be careful about unmerged paths, though. They
> will not get anything other than $1 (name).
I don't know how to manage this correctly, so I just display a message
"Unmerged path $1" and die.
> You would probably not care about the mode changes for oo
> documents, but they are available as $4 and $6 respectively, if
> you care.
I don't care, but the new version still manages them ;-).
All this convince me that the ability to provide a plaintext converter
(see the other thread I started) would make it much simpler to write
such kind of things. The mode change, for example, could be managed
automatically by git, I wouldn't need to write my own 'echo "new
mode ..."'.
Thanks for the advices.
--
Matthieu
http://www-verimag.imag.fr/~moy/opendocument/git-oodiff
#! /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
convert_to_txt ()
{
if [ x"$1" = x"/dev/null" ]; then
printf "" > /tmp/oodiff.$$."$2"
eval "label$2=/dev/null/"
else
odt2txt "$1" > /tmp/oodiff.$$."$2" 2>/dev/null
fi
}
echo $(basename $0) "$2" "$5"
if [ "$#" = "1" ]; then
echo "Unmerged path $1"
exit 0
fi
if [ x"$4" = x"." ]; then
echo "new file mode $7"
elif [ x"$7" = x"." ]; then
echo "deleted file mode $4"
elif [ x"$4" != x"$7" ]; then
echo "old mode $4"
echo "new mode $7"
fi
label1="a/$1"
label2="a/$1"
if convert_to_txt "$2" "1" &&
convert_to_txt "$5" "2" ; then
if diff -L "$label1" -L "$label2" -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 "$label1" -L "$label2" -u "$2" "$5"
fi
rm -f /tmp/oodiff.$$.{1,2}
next prev parent reply other threads:[~2007-08-27 12:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vpqtzql17gd.fsf@bauges.imag.fr \
--to=matthieu.moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.