Signed commits not being accepted with GPG running in Cygwin, throws "gpg-no-tty.sh: line 22: exec: gpg: not found error: gpg failed to sign the data fatal: failed to write commit object" #1066
Description
Per request, this has been resubmitted from #1039
Prerequisites
- Have you tried to reproduce the problem in Safe Mode?
- Have you followed all applicable steps in the debugging guide?
- Have you checked the FAQs on the message board for common solutions?
- Have you checked that your issue isn't already filed?
Description
When attempting to commit staged changes with a signed commit, Atom fails to create commit and throws an error msg. However signed commits are getting passed through Zsh shell running in hyper terminal.
Steps to Reproduce
- Install cygwin:
[v2.881 64bit]
- Run cygwin to install the following packages:
git[2.13.2]
gnupg:[v1.4.21-1]
zsh[5.3]
- Generate a GPG key w/ passphrase
- Make changes to a repo in Atom
- Move changes from 'Unstaged Changes' to 'Staged Changes'
- Attempt to commit changes with GPG signature
- Password dialog pops up asking for passphrase
- Hit 'enter'
- Commit fails
Expected behavior:
For cryptographically signed commits to be accepted
Actual behavior:
Atom throws the following error:
gpg-no-tty.sh: line 22: exec: gpg: not found error: gpg failed to sign the data fatal: failed to write commit object
Reproduces how often:
100%
Versions
OS: [win 10 64bit]
cygwin: [v2.881 64bit]
shell: [Zsh 5.3, oh-my-zsh]
gitflow: [AVH Edition]
gnupg: [v1.4.21-1]
terminal: [Hyper 1.3.3]
Running atom --version
in cmd.exe produces:
Atom: [1.18.0]
Electron [1.3.15]
Chrome: [52.0.2743.82]
Node: [6.5.0]
Running apm --version
in cmd.exe produces:
apm: [1.18.1]
npm: [3.10.10]
node: [6.9.5 x64]
git: [2.13.2]
Note:
*Running both atom --version
and apm --version
in hyper zsh shell produced no output for my particular setup.
Additional Information
gpg set as the default in global config
git config --global gpg.program $(which gpg)
Every commit signed by default set to true
git config --global commit.gpgsign true
The signingkey set with:
git config --global user.signingkey <key-id>
Path to gpg in windows env variables set to:
C:\cygwin64\bin\gpg.exe
Running: git config --list --show-origin
produces:
...
...
file:/cygdrive/c/Users/$USER/.gitconfig gpg.program=gpg
file:/cygdrive/c/Users/$USER/.gitconfig commit.gpgsign=true
...
file:.git/config gpg.program=gpg
Running which gpg
Produces:
/usr/bin/gpg
Running process.env.PATH
from atom chrome dev-tools
along with echo ${PATH}
in terminal both produce:
... C:\cygwin64\bin\gpg ...
Replacing gpg1.4 for gpg2 produced the same error msg within Atom, while cryptographically signed commits continued to work through Zsh shell for both gpg and gpg2.
Earlier, I manually set the Path to cygwin in windows environmental variables to:
C:\cygwin64\bin\
but it produced a *** fatal error - cygheap base mismatch detected
error so I removed it. The error also produced instruction to perform a system wide search for cygwin1.dll, to remove any older duplicates, and reboot, however the system only found one cygwin1.dll file located in C:\cygwin64\bin\
and rebooting did not resolve it either, so I ended up unsetting it from windows path.
Any help would be much appreciated!
Update:
- corrected miscellaneous grammar / spelling oversights.