Skip to content

Support schemes for URL base definitions #106

@chrgernoe

Description

@chrgernoe

I have a use case where the Git server is accessed either via SSH and HTTPS, depending on the usage. For local development users use SSH to access the server and for CI, I have to use HTTPS because the CI user has no SSH key and often the infrastructure does not support SSH for security reasons.

Feature proposal:
Support scheme-specific url-base definitions for every remote (or maybe even an arbitrary url-base scheme) that can be selected during update/clone/... on the command line and via environment variable.

# For backward compatibility and also for repos that are for some reasons always accessible via a single scheme, the `url-base` key inside the TOML file should be supported as well.
[[remotes]]
name = "style0"
url-base = "https://..."

# Remote with different schemes
[[remotes]]
name = "style1"
url-base.ssh = "ssh://..."
url-base.https = "https://..."
url-base.file = "file://..."

# Invalid remote definition
[[remotes]]
name = "invalid"
url-base = "https://..."
url-base.ssh = "ssh://..."

[defaults]
remote = "syle0"
url-base-scheme = "ssh"

There shall be command line option for all relevant sub-commands to override the URL base scheme e.g. --url-base-scheme and the user should be able to override the default via an environment variable e.g. GIT_WS_URL_BASE_SCHEME. This makes it easy to switch the scheme without script changes e.g. in CI mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions