git-crypt icon indicating copy to clipboard operation
git-crypt copied to clipboard

Unlock is failing under Windows and Linux (smudge filter failed).

Open edpichler opened this issue 3 years ago • 4 comments

I installed the official version released (git-crypt-0.7.0-x86_64.exe) for Windows and tried to unlock my repository. It seems it fails with some files. Possible encoding problem? This repo is being used successfully in Unix envs.

PS C:\Users\Edu\Documents\GitHub\zettelkasten> git-crypt-0.7.0-x86_64.exe unlock
git-crypt: error: encrypted file has been tampered with!
error: external filter '"C:\\Program Files\\git-crypt\\git-crypt-0.7.0-x86_64.exe" smudge' failed 1
error: external filter '"C:\\Program Files\\git-crypt\\git-crypt-0.7.0-x86_64.exe" smudge' failed
fatal: Company/secrets/git/README.md: smudge filter git-crypt failed
Error: 'git checkout' failed
git-crypt has been set up but existing encrypted files have not been decrypted

The same error is happening in Ubuntu Linux.

edpichler avatar Sep 22 '22 12:09 edpichler

After the 'unlock' everything stop working. I cannot commit/stash/revert and I can't even lock it again because the pending file (showing in the fatal error line) needs to be solved.

edpichler avatar Sep 23 '22 12:09 edpichler

I have the same issue but only in Windows, it works fine in my Ubuntu 20.04 WSL2

maxisam avatar Dec 21 '22 22:12 maxisam

I figured it out. It is because of CRLF. It is easy to workaround this issue.

the secret file has to be LF use

eol=lf filter=git-crypt diff=git-crypt to ensure it doesn't get converted to CRLF in Windows

maxisam avatar Dec 21 '22 23:12 maxisam

I just wanted to share that I spent quite a few hours debugging this issue.

viktorgt avatar Aug 21 '23 08:08 viktorgt