Last active
August 29, 2015 14:27
-
-
Save carstene1ns/f024f1bc5a36fcf94799 to your computer and use it in GitHub Desktop.
git diff output for rpg maker files using easyrpg's lcf2xml tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.lmu diff=easyrpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
attributesfile = ~/.gitattributes | |
[diff "easyrpg"] | |
command = git-easyrpg-diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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