AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.18k stars 475 forks source link

Change clean command to only operate on non-encrypted files as recommended by git docs #179

Closed jirutka closed 4 years ago

jirutka commented 5 years ago

As recommended by gitattributes(5):

For best results, clean should not alter its output further if it is run twice ("clean->clean" should be equivalent to "clean"), and multiple smudge commands should not alter clean's output ("smudge->smudge->clean" should be equivalent to "clean").

I've extracted this change from #107.

Co-Authored-By: @shlomosh

AGWA commented 5 years ago

Does this solve an actual problem? I understand that this is recommended by gitattributes(5), but that man page is thinking of filters that do things like strip carriage returns, which could hypothetically have already been done before committing. Under what circumstances could a file already be encrypted when being committed (that doesn't indicate a deeper problem that needs to be fixed)? I am very hesitant about adding a code path that could cause encryption to be bypassed, so I am seeking to really understand the motivation behind this. Thanks.

jirutka commented 5 years ago

To be honest, I don’t know. I’m just refactoring #107 and this change is not related to the merge command, so I’ve extracted it into a separate PR.