Skip to content

Instantly share code, notes, and snippets.

@JonathonMA
Created May 19, 2015 04:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathonMA/83cf96008c078d5f907a to your computer and use it in GitHub Desktop.
Save JonathonMA/83cf96008c078d5f907a to your computer and use it in GitHub Desktop.
#!/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