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
Pre-commit hook to avoid accidentally adding unencrypted files #45
Comments
|
Sorry for the late reply to this. Something like this is a good idea; thanks for the suggestion! I'll try to roll this in to the next release. |
|
+1 Mays be it shall be proposed automatically upon git-crypt init. |
|
I didn't realize this could happen, whew! thanks for this. I'm adding a default pre-commit hook (using |
|
Consider also for |
|
actually, I discovered that I created a new issue #68 to request quiet flag in |
|
@smemsh: I didn't like that this fails silently without any indication as to what went wrong, so I modified yours slightly to: test -d .git-crypt && git-crypt status &>/dev/null
if [[ $? -ne 0 ]]; then
git-crypt status -e
exit 1
fi(just leaving as a suggestion for future readers) |
|
Hi @smemsh. Any (documentation / release) update to deal with this issue ? I confess I lost track of the preferred approach... |
|
Fyi, my own version of the pre-commit hook is available here. |
|
I have filed #201 before seeing this issue. In my opinion having a pre-commit hook is sub-optimal. It needs to process all files. While having the functionality in git-crypt itself will be way more efficient. Edit: on the other hand that will still not help people that cloned repo for the first time without taking extra steps. But still I think inbuilt into git-crypt will be more efficient. |
I don't think this isn't true. |
This should not happen very often, but for users who do not read the doc, or someone who has locked their repository a long time ago and forgot about it, it could be useful to try and prevent this situation:
secret.filehas been added to.gitattributes, but the repository was locked so the person ended up adding it unencrypted.git-crypt statusalready displays a huge warning in this situation, but it remains possible to make a mistake when it is not run. May I suggest adding to the documentation an example of a pre-commit hook such as this:The text was updated successfully, but these errors were encountered: