Conversation
Julow
left a comment
There was a problem hiding this comment.
This sounds like adding support for the "scp syntax" to the library. Perhaps this should be documented somewhere ?
a remote host with optional path in the form [user@]host:[path]
Git calls it "scp-like syntax": https://git-scm.com/docs/git-clone#_git_urls but with a special case:
This syntax is only recognized if there are no slashes before the first colon. This helps differentiate a local path that contains a colon
lib_test/test_runner.ml
Outdated
| let urn2= Uri.with_scheme urn (Some "urn") in | ||
| assert_equal ~printer urn urn2; | ||
| let git = Uri.of_string "git@github.com:owner/repo" in | ||
| assert_equal ~printer:Fmt.(to_to_string (option string)) (Uri.scheme git) None ; |
There was a problem hiding this comment.
The path of user@host:50/repo should be 50/repo. Can you add a test to make sure it isn't picked as the port number ?
There was a problem hiding this comment.
That would indeed allow me to use it in dune-release !
There was a problem hiding this comment.
All information move as a path part of the given Uri.t. Again, this PR does not want to fix your initial issue but it wants to respect a little better the RFC (and disallow @ as a possible character of the scheme part). If you really want to accept and understand something like git@github.com:owner/repo, you should take a look on emile - with a split on : - which one best fits your case.
A simple fix to disallow
@on scheme according to RFC 3986. We need aREVDEPto be sure to not break anything.