First time decryption fails
alehed opened this issue · 4 comments
Before the key is loaded, decryption fails. I get the error:
gpg: decryption failed: No secret key
...
subprocess.CalledProcessError: Command '['pass', 'show', 'Git/gitlab.com']' returned non-zero exit status 2
In case the key is not loaded yet, the user is prompted for the passphrase. But since the script communicates to git via a pipe, this fails.
You need to usw gpg-agent with a graphical passphrasd dialog for this to work. Other uses are not intended.
I'm working entirely in the command line (also the reason I'm using pass) so this is not really an option. I also tried to implement my own handler in python, but I came across the same problem.
For this to work you would have to be able to directly access stdin and stdout from the program.
I settled for a key without a passphrase for git repos.
I don't see a real solution as git requires std in and out for the operations.
I guess this is a limitation of the git credential provider interface then.