git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Calling "gpg --sign" with loopback pinentry in some scenarios, but not always
@ 2024-02-17 22:51 Jens Schmidt
  2024-02-17 23:31 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Schmidt @ 2024-02-17 22:51 UTC (permalink / raw)
  To: git

Hi.

I'd like to use gpg loopback pinentry mode when signing commits
or tags through Emacs/Magit but default, non-loopback pinentry
for all other cases.

In particular, configuring "pinentry-mode loopback" in "gpg.conf"
is not really an option for me.

It seems that "git" does not have any hooks to pass arbitrary
additional parameters to "gpg", right?  So my only reasonable
option would be a Emacs/Magit-specific "gpg"-wrapper that adds
command line parameter "--pinentry-mode loopback" to the wrapped
"gpg" executable.

Any other options?

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Calling "gpg --sign" with loopback pinentry in some scenarios, but not always
  2024-02-17 22:51 Calling "gpg --sign" with loopback pinentry in some scenarios, but not always Jens Schmidt
@ 2024-02-17 23:31 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2024-02-17 23:31 UTC (permalink / raw)
  To: Jens Schmidt; +Cc: git

Jens Schmidt <farblos@vodafonemail.de> writes:

> It seems that "git" does not have any hooks to pass arbitrary
> additional parameters to "gpg", right?  So my only reasonable
> option would be a Emacs/Magit-specific "gpg"-wrapper that adds
> command line parameter "--pinentry-mode loopback" to the wrapped
> "gpg" executable.

Correct.  You can point your gpg.program configuration variable at
your wrapper, perhaps

    $ cat >"$HOME/bin/mygpg-with-pinentry" <<\EOF
    #!/bin/sh
    exec gpg --pinentry-mode loopback "$@"
    EOF
    $ chmod +x "$HOME/bin/mygpg-with-pinentry"
    $ git config gpg.openpgp.program "$HOME/bin/mygpg-with-pinentry"

or something like that.  It is unfortunate that

    $ git config gpg.openpgp.program "gpg --pinentry-mode loopback"

does not work.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-17 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-17 22:51 Calling "gpg --sign" with loopback pinentry in some scenarios, but not always Jens Schmidt
2024-02-17 23:31 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).