Skip to content

Instantly share code, notes, and snippets.

@wizardishungry
Created April 13, 2009 21:47
Show Gist options
  • Save wizardishungry/94750 to your computer and use it in GitHub Desktop.
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.
*.plist filter=xmlplist
# surprise! Quartz patches are plists, too!
*.qtz filter=xmlplist
[filter "xmlplist"]
clean = "git-plutil-filter.sh"
smudge = "git-plutil-filter.sh"
#!/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