Skip to content

Instantly share code, notes, and snippets.

@carstene1ns
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carstene1ns/f024f1bc5a36fcf94799 to your computer and use it in GitHub Desktop.
Save carstene1ns/f024f1bc5a36fcf94799 to your computer and use it in GitHub Desktop.
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