Skip to content
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

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

Open
edpichler opened this issue Sep 22, 2022 · 4 comments
Open

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

edpichler opened this issue Sep 22, 2022 · 4 comments

Comments

@edpichler
Copy link

edpichler commented Sep 22, 2022

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
Copy link
Author

edpichler commented Sep 23, 2022

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 edpichler changed the title Unlock is failing under Windows (smudge filter failed). Unlock is failing under Windows and Linux (smudge filter failed). Sep 23, 2022
@maxisam
Copy link

maxisam commented Dec 21, 2022

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

@maxisam
Copy link

maxisam commented Dec 21, 2022

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

@viktorgt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants