GitSavvy: Signing fails via GPG

Related to #581 but not on windows.

`/usr/bin/git commit -q -F -` failed with following output:

gpg: cannot open `/dev/tty': Device not configured
error: gpg failed to sign the data
fatal: failed to write commit object

On the terminal it works, and no password is asked. I guess it is cached or handled automatically with

[credential]
	helper = osxkeychain

Since no interactin is actually required, is there any configuration possible which allows this to work?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (17 by maintainers)

Most upvoted comments

Since git remains a command line tool, we depend on the arguments it supports, and I don’t believe it’s core gpg implementation supports specifying parameters to the gpg command.

I wouldn’t say it’s the only program to require no-tty, any GUI git tool that wraps around command-line git app, will have the same issue. For example see isaacs/github#675, sourcetree or Tower.

Interesting… Looking at sourcetree solution, they pass a “custom” gpg.program configuration for the commit command, to a script that wraps around gpg:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree -c gpg.program=/Applications/SourceTree.app/Contents/Resources/bin/stgpg.sh commit -q --gpg-sign=FAE3579EEA1C6363 -F /var/folders/jw/5wfdcdr137q_hh1jw5nzcyvw0000gp/T/SourceTreeTemp.LiStAR

screen shot 2017-04-13 at 08 53 28

This is a pretty awesome workaround, at least for systems that have bash, and one that we can surely implement. For windows, the current solution should already work, since windows requires an installed GnuPG client which does not default to run in terminals (no-tty not required). (NOTE: Windows needs confirmation).

This is my gist that explain how to enable auto-signing of Git commits for EVERY programs that don’t support it natively… It’s specifically for Windows systems!!