ShahradR / windows-dev

Windows development image used for personal projects
MIT License
0 stars 0 forks source link

Cannot sign previous commits using GPG #3

Closed ShahradR closed 4 years ago

ShahradR commented 6 years ago

When trying to sign previous commits using GPG while in an interactive rebase, the following error message is returned:

error: gpg failed to sign the data
fatal: failed to write commit object
ShahradR commented 6 years ago

When trying to sign the word "test" directly with gpg2 returns the following error message:

$ echo "test" | gpg2 --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clearsign failed: Inappropriate ioctl for device

It seems that the problem would be related to gpg2, rather than git itself.

ShahradR commented 6 years ago

The issue was caused by GPG not knowing which TTY to use for input/output. Exporting the GPG_TTY environment variable resolved the issue!

gpg-pinentry

Note that this requires that pinentry-tty be installed.