jschauma/jass

Feature: git attribute filter integration

Opened this issue · 0 comments

git-crypt has built-in support for git attribute's filters, which allows it to hook into the git checkout/add/commit sub-commands for automatic encryption during add/commit, as well as keeping the repo "unlocked" for normal use - but re-encrypting it during add/commit sub-commands while unlocked.

This major advantage wins over the other encryption tool, git encrypt, is that everything is transparent to the local user (decrypting-on-git-clone/encrypting-on-git-commit) while leaving the local files unlocked. All the end-user has to do is git-crypt unlock one time after the initial git clone.

Today, I started poking around how git-crypt does that and ran across their C code for it:

https://github.com/AGWA/git-crypt/blob/788a6a99f4289745e6bd12fae2ad8014af320a4f/commands.cpp#L149-L168

Doesn't look too complicated. But, it is involved.

Because I have an immediate need, I am going to write a bunch of bash scripts for now to register/deregister and other git config stuff related to filters attributes to make this work. But I can easily see this as a set of sub-commands for jass to take in. like:

jass init # does all of the git config registrations

And maybe a few others, like the removal/de-registrations, etc.