Skip to content

GPG sign commit does not work for loopback mode #5438

Open
@xudyang1

Description

@xudyang1

Issue

Version 2.47.0 and newer breaks gpg sign commit when using loopback mode. The loopback mode does not work as expected, thus an user can not enter passphrase to sign the commit.

Reproduce

  1. download git from scoop or other means
  • latest: scoop install git
  • or,
  • version 2.47.0: scoop install https://raw.githubusercontent.com/ScoopInstaller/Main/788e274292442e9fea6d944ca61a62be0ebacab4/bucket/git.json
  1. enable sign commit: git config --global commit.gpgsign true
  2. enable lookback pinentry mode:
  • ~/.bashrc:
GPG_TTY=$(tty)
export GPG_TTY
  • ~/.gnupg/gpg-agent.conf:
# disable pinentry modal popup
allow-loopback-pinentry
  • ~/.gnupg/gpg.conf
use-agent

# disable pinentry modal popup
pinentry-mode loopback
  1. testing commands:
  • mkdir test-gpg; cd test-gpg; git init; echo '123' >> a.txt; git add -A; GIT_TRACE=1 git commit -m "test";
  • The loopback mode does not work because tty does not ask for passphrase. With error message:
... 
gpg: cannot open 'no tty': No such file or directory
error: gpg failed to sign the data:
....

More

  • version 2.46.2 works fine:
    • download git by scoop install https://raw.githubusercontent.com/ScoopInstaller/Main/6ef718a96949c6d1aece63b6cea83d3aedc7125d/bucket/git.json
    • manifest link https://github.com/ScoopInstaller/Main/commit/6ef718a96949c6d1aece63b6cea83d3aedc7125d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions