Created
May 19, 2015 04:15
-
-
Save JonathonMA/83cf96008c078d5f907a to your computer and use it in GitHub Desktop.
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 | |
# ansible-vault-git-diff -- show what changed in a vaulted file at a specific commit | |
commit="$1" | |
file="$2" | |
if [ -z "$2" ]; then | |
echo "Usage: $0 <commit> <file>" | |
exit 1 | |
fi | |
contents_of() { | |
ansible-vault view <( git show "$1":"$2" ) | |
} | |
diff -u <( contents_of "${commit}^" "${file}" ) <( contents_of "${commit}" "${file}" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment