Skip to content
Snippets Groups Projects
Commit 3e052d84 authored by Samuel Le Thiec's avatar Samuel Le Thiec Committed by Jason A. Donenfeld
Browse files

configure git to decrypt gpg files automatically

    - usefull for git commands showing diff, e.g.: pass git log -p
    - from what I can see, not 'cleartext' temporary files are created
parent ba160d43
No related branches found
No related tags found
No related merge requests found
......@@ -557,6 +557,11 @@ cmd_git() {
if [[ $1 == "init" ]]; then
git "$@" || exit 1
git_add_file "$PREFIX" "Add current contents of password store."
echo '*.gpg diff=gpg' > "$PREFIX/.gitattributes"
git_add_file .gitattributes "Assigning diff attribute for gpg files"
git config --local diff.gpg.binary true
git config --local diff.gpg.textconv "$GPG ${GPG_OPTS[*]} --decrypt"
elif [[ -d $GIT_DIR ]]; then
exec git "$@"
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment