Skip to content

Commit

Permalink
Merge pull request #69 from arcticicestudio/feature/gh-64-transparent…
Browse files Browse the repository at this point in the history
…-git-gpg-encryption-with-smudge-clean-filters

Transparent Git encryption using GPG
  • Loading branch information
arcticicestudio authored Nov 16, 2017
2 parents ab4513b + da05874 commit 32c24ce
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions snowblocks/git/git-diff-igloocrypt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2017 Arctic Ice Studio <[email protected]>
# Copyright (c) 2016-2017 Sven Greb <[email protected]>

# Project: igloo
# Repository: https://github.com/arcticicestudio/igloo
# License: MIT

# GPG decryption command for the "igloocrypt" diff filter
# The output is redirected to suppress error messages caused by the Git filter flow.

gpg --decrypt --batch --no-tty "$1" > /dev/null 2>&1 || cat $1
14 changes: 14 additions & 0 deletions snowblocks/git/gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2016-2017 Arctic Ice Studio <[email protected]>
# Copyright (c) 2016-2017 Sven Greb <[email protected]>

# Project: igloo
# Repository: https://github.com/arcticicestudio/igloo
# License: MIT
# References:
# https://git-scm.com/docs/gitattributes
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion
# https://www.gnupg.org
# https://wiki.archlinux.org/index.php/GnuPG

*.igloocrypt filter=igloocrypt diff=igloocrypt
.gitattributes !filter !diff
7 changes: 7 additions & 0 deletions snowblocks/git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
tool = intellij
compactionHeuristic = true

[diff "igloocrypt"]
textconv = ".git-diff-igloocrypt"

[difftool "intellij"]
prompt = true
cmd = idea diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
Expand All @@ -63,6 +66,10 @@
stripLeadingSymbols = true
useUnicodeRuler = true

[filter "igloocrypt"]
clean = "gpg --encrypt --recipient 60C54F1519346085"
smudge = "gpg --decrypt"

[merge]
tool = intellij
ff = false
Expand Down
2 changes: 2 additions & 0 deletions snowblocks/git/snowblock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
},
{
"link": {
"~/.gitattributes": null,
"~/.git-commit-msg": null,
"~/.git-diff-igloocrypt": null,
"~/.gitconfig": null,
"~/.gitconfig_auth": null,
"~/.gitconfig_auth_job": null,
Expand Down

0 comments on commit 32c24ce

Please sign in to comment.