signing: change default gpg program, add --keyid-format option accordingly

This is the default of Git, and Debian sid doesn't install the gpg2 symlink
by default.

https://github.com/git/git/blob/v2.43.2/gpg-interface.c#L92
https://github.com/martinvonz/jj/pull/3007#discussion_r1496877808
https://packages.debian.org/bookworm/gnupg2
This commit is contained in:
Yuya Nishihara 2024-02-21 21:36:31 +09:00
parent 6c31bab0d3
commit e3d2ff2b75

View file

@ -109,7 +109,7 @@ impl GpgBackend {
Self::new(
config
.get_string("signing.backends.gpg.program")
.unwrap_or_else(|_| "gpg2".into())
.unwrap_or_else(|_| "gpg".into())
.into(),
config
.get_bool("signing.backends.gpg.allow-expired-keys")
@ -167,6 +167,7 @@ impl SigningBackend for GpgBackend {
let output = self.run(
data,
&[
"--keyid-format=long".as_ref(),
"--status-fd=1".as_ref(),
"--verify".as_ref(),
// the only reason we have those .as_refs transmuting to &OsStr everywhere