Created
April 13, 2009 21:47
-
-
Save wizardishungry/94750 to your computer and use it in GitHub Desktop.
Apple's .plist files have two equivalent on-disk representations, binary and xml. These snippets help keep binary crap out of your repository.
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
*.plist filter=xmlplist | |
# surprise! Quartz patches are plists, too! | |
*.qtz filter=xmlplist |
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
[filter "xmlplist"] | |
clean = "git-plutil-filter.sh" | |
smudge = "git-plutil-filter.sh" |
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/sh | |
# had to do this because git doesn't like attaching stdin and out to plutil (waitpid error) | |
#TMPDIR isn't set for ssh logins! | |
TMPDIR=`getconf DARWIN_USER_TEMP_DIR` | |
tempfoo=`basename $0` | |
TMPFILE=`mktemp ${TMPDIR}/${tempfoo}.XXXXXX` || exit 1 | |
cat > $TMPFILE | |
plutil -convert xml1 $TMPFILE | |
cat $TMPFILE | |
rm $TMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment