-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pre-commit hook example #600
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Will this not be a really bad suggestion for anybody using git-secret to share secrets among team members? It means all the secret files will be re-encrypted on every commit, overwriting any changes that might have been made by other people to the repository, since it doesn't decrypt the secret files when changes are pulled in. |
@Tenzer I have never used |
Maybe @asottile can help us 🙂 |
It's worth noting there's two different things with the name "pre-commit" that might cause some confusion:
In order to avoid the problem I described above, you would probably need to add a I'm not sure I have a glorified solution for how to accomplish this, but I would urge to give it a bit more thought before recommending people to add a hook like this to their Git repositories. |
iirc usually these types of tools are used as smudge filters and not as pre-commit hooks (such that the contents on disk are unencrypted but encrypted in git) |
Ah, right. That's what git-crypt does: https://www.agwa.name/projects/git-crypt/. |
I don't really get the difference between git-crypt and git-secret. @Tenzer Good point. I also don't think that auto-decryption is a good idea for the reasons you mentioned. I am going to close this PR since I don't think it is a good recommendation in general. |
Looking at the docs, it seems the big difference between git-secret and git-crypt is that with git-secret, you manually encrypt and decrypt the secrets you want to put in the repo, but with git-crypt, encryption happens for you transparently when you commit and check out files. Also git-secret is written in bash and was last released in Sept 2019, whereas git-crypt is written in C++ and was last released in Nov 2017. |
Add pre-commit hook example as discussed in #92 (comment)