straight-vc-git-default-protocol is currently a global setting. We can define either ssh or https for all hosts. Users who have SSH keys for GitHub but not for GitLab or Codeberg are forced to add straight-register-package overrides for every package hosted on non-GitHub forges.
For example, with the recent zig migration, although melpa defines the formula properly, current workaround required a per-package override:
(straight-register-package
'(zig-mode :type git :host nil
:repo "https://codeberg.org/ziglang/zig-mode.git"))
My feature request is to allow straight-vc-git-default-protocol to accept an alist mapping hosts to protocols, falling back to a default:
(setq straight-vc-git-default-protocol
'((github . ssh)
(t . https)))
(Note: might be better to call it like straight-vc-git-default-protocol for backwards compatibility?)
Or better yet separate variable:
(setq straight-vc-git-host-protocol-alist
'((github . ssh)
(gitlab . https)
(codeberg . https)))
I think the alist approach might blend seamlessly with custom hosts.
Either approach should eliminate the need for per-package recipe overrides when the only issue is the protocol, not the repo location.
straight-vc-git-default-protocolis currently a global setting. We can define eithersshorhttpsfor all hosts. Users who have SSH keys for GitHub but not for GitLab or Codeberg are forced to addstraight-register-packageoverrides for every package hosted on non-GitHub forges.For example, with the recent zig migration, although melpa defines the formula properly, current workaround required a per-package override:
My feature request is to allow
straight-vc-git-default-protocolto accept an alist mapping hosts to protocols, falling back to a default:(Note: might be better to call it like
straight-vc-git-default-protocolfor backwards compatibility?)Or better yet separate variable:
I think the alist approach might blend seamlessly with custom hosts.
Either approach should eliminate the need for per-package recipe overrides when the only issue is the protocol, not the repo location.