Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

✨ generic url representation #10

Open
jeftadlvw opened this issue May 14, 2024 · 0 comments
Open

✨ generic url representation #10

jeftadlvw opened this issue May 14, 2024 · 0 comments
Labels
feature request New feature or request
Milestone

Comments

@jeftadlvw
Copy link
Owner

Currently, only http urls are supported. But many developers use shh to clone and manage their repositories. It may be better to have a generic representation of a url that can be converted into multiple supported protocols (the obvious being http/https and ssh). The problem is that they both share the same structure (hostname and path), but everything behind that is specific for that protocol.

Take port numbers for example. Http uses 80, Https 443. Ssh by default 22. All these ports can be changed by the hosting solution and the protocol specifications allow custom ports. Custom port numbers need to be stored for every supported url type.

A possible solution would be to use a basic structure like hostname$path and add every other customization as tags behind it: hostname$path[tag-1:foo | tag-2:bar | tag-3:baz].

Some practical tags could be:

  • http-port: int
  • http-secure: boolean
  • ssh-port: int
  • ssh-user: string

Each tag has a documented default value.

The final configuration could look like this:

[config]
  # future configuration here

[[submodule]]
  path = "path-to-submodule"
  url = "hostname$path[http-secure: true | ssh-port:5000]"
  ref = "branch, tag or commit"

This also enables to clone new nested modules through the same url type as the repository's origin url.

@jeftadlvw jeftadlvw added the feature request New feature or request label May 14, 2024
@jeftadlvw jeftadlvw added this to the v0.0.2 milestone May 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant