Skip to content

Instantly share code, notes, and snippets.

@carstene1ns carstene1ns/.gitattributes
Last active Aug 29, 2015

Embed
What would you like to do?
git diff output for rpg maker files using easyrpg's lcf2xml tool
*.lmu diff=easyrpg
[core]
attributesfile = ~/.gitattributes
[diff "easyrpg"]
command = git-easyrpg-diff
#!/bin/bash
TEMP=$(mktemp -d -p "" easyrpg.XXXXXXXXXX)
if [ "xtrue" == "x$GIT_PAGER_IN_USE" -o "xcat" == "x$GIT_PAGER" ]; then
DIFF=$(which colordiff || diff)
else
DIFF="diff"
fi
echo "easyrpg-diff a/$1 b/$5"
echo "mode $4 -> $7"
echo "index ${3:0:8} -> ${6:0:8}"
if [ -d $TEMP ]; then
lcf2xml $2 $TEMP/old.xml
lcf2xml $5 $TEMP/new.xml
$DIFF $TEMP/old.xml $TEMP/new.xml
rm -rf $TEMP
else
echo "Unable to create temporary directory!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.