2

We sign each commit with GPG2 for security purposes. Usually this involves a full-terminal-window "popup" asking you to enter a password after running git commit (the terminal screen is replaced with just the GPG message). However we have started using python's pre-commit tool run linting prior to committing, and the "pop-up" isn't appearing. Here is the error I get:

$ git commit -m "fix linting issues"
autopep8 wrapper.........................................................Passed
Flake8...................................................................Passed
Check python ast.........................................................Passed
Check for added large files..............................................Passed
Check JSON...............................................................Passed
Check for merge conflicts................................................Passed
Check for case conflicts.................................................Passed
Check Yaml...............................................................Passed
Debug Statements (Python)................................................Passed
Detect Private Key.......................................................Passed
Fix double quoted strings................................................Passed
Fix End of Files.........................................................Passed
Forbid new submodules....................................................Passed
Trim Trailing Whitespace.................................................Passed
Pretty format JSON.......................................................Passed
pylint...................................................................Passed

error: gpg failed to sign the data
fatal: failed to write commit object
2
  • 1
    What kind of pinentry program do you use? pinentry-curses? Do you use gpg-agent? Have you configured environment variable GPG_TTY?
    – phd
    Apr 16, 2019 at 14:04
  • I'm unable to reproduce this, as was the individual who reported it to the bug tracker -- is it possible you waited too long and didn't enter your gpg key passphrase? Sep 3, 2019 at 0:08

1 Answer 1

1

I ran into this issue today. My configuration uses gpg-agent along with an Xorg-based pinentry application

Restoring the pre-pre-commit behavior required adding no-tty to the existing gpg-agent.conf after enabling pre-commit

It's not an issue or bug with pre-commit, but installing pre-commit into an otherwise functional gpgsign enabled repository can effectively "break" signing depending on your configuration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.