public inbox for tools@linux.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Support SSH user.signingkey
@ 2026-03-28 23:22 Bingwu Zhang
  2026-04-10 14:36 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 2+ messages in thread
From: Bingwu Zhang @ 2026-03-28 23:22 UTC (permalink / raw)
  To: Kernel . org Tools; +Cc: Konstantin Ryabitsev, Bingwu Zhang

From: Bingwu Zhang <xtex@astrafall.org>

Check gpg.format to see if user.signingkey is a SSH
key.

Signed-off-by: Bingwu Zhang <xtex@astrafall.org>
---
 src/patatt/__init__.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/patatt/__init__.py b/src/patatt/__init__.py
index ae8f21ea104f..ac610b87bc6d 100644
--- a/src/patatt/__init__.py
+++ b/src/patatt/__init__.py
@@ -1312,10 +1312,13 @@ def get_algo_keydata(config: GitConfigType) -> Tuple[str, str]:
         return algo, keydata
 
     if not config.get('signingkey'):
-        if usercfg.get('signingkey'):
-            logger.info('N: Using pgp key %s defined by user.signingkey', usercfg.get('signingkey'))
+        user_signingkey = usercfg.get('signingkey')
+        if user_signingkey:
+            gpg_format = get_config_from_git(r'gpg\..*').get('format', 'gpg')
+            key_algo = 'openssh' if gpg_format == 'ssh' else 'openpgp'
+            logger.info('N: Using %s key %s defined by user.signingkey', key_algo, user_signingkey)
             logger.info('N: Override by setting patatt.signingkey')
-            config['signingkey'] = 'openpgp:%s' % usercfg.get('signingkey')
+            config['signingkey'] = '%s:%s' % (key_algo, user_signingkey)
         else:
             logger.critical('E: patatt.signingkey is not set')
             logger.critical('E: Perhaps you need to run genkey first?')

base-commit: d8ea60b65cad9b92003eef92153457736652e2bd
-- 
2.52.0


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

* Re: [PATCH] Support SSH user.signingkey
  2026-03-28 23:22 [PATCH] Support SSH user.signingkey Bingwu Zhang
@ 2026-04-10 14:36 ` Konstantin Ryabitsev
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2026-04-10 14:36 UTC (permalink / raw)
  To: Kernel . org Tools, Bingwu Zhang; +Cc: Bingwu Zhang


On Sun, 29 Mar 2026 07:22:34 +0800, Bingwu Zhang wrote:
> Support SSH user.signingkey

Applied, thanks!

[1/1] Support SSH user.signingkey
      commit: cff270b5476ff891cf884eabe8cc18e89c9822a5

Best regards,
-- 
KR



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

end of thread, other threads:[~2026-04-10 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 23:22 [PATCH] Support SSH user.signingkey Bingwu Zhang
2026-04-10 14:36 ` Konstantin Ryabitsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox