Skip to content

Support per-host protocol defaults #1290

Description

@khinshankhan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions