m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Le Thiec <samuel.lethiec@intelunix.fr>2014-05-10 17:18:30 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-05-10 17:22:28 +0200
commit3e052d8455846669a831bd3eb11b441da804b75d (patch)
tree1620dcc9e29892bd9814c88cc984d112ed6c43e3 /src
parentba160d43eb84be181258c26aa66bcaf05964c909 (diff)
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
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index a4783b4..f466a8f 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -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