gitiles lister: transform ssh:// to http:// or https://
The gitiles lister added in swh/meta#5045 (closed) filters out ssh://
URLs but on many gitiles listers, if you change the ssh://
URLs to http://
or https://
(whatever the forge URL uses) and remove the port number, then you can sometimes clone git repositories using the resulting URLs. This does not work with all the gitiles ssh-only instances but for at least a few of them it does. Here is an example of where it works:
For example:
$ curl https://gerrit.int.com/plugins/gitiles/?format=JSON |
tail -n +2 |
jq -r .[].clone_url |
sed 's_^ssh://_https://_;s_:29418/_/_' |
head -n 1
https://gerrit.int.com/PubliclyAvailable
$ git ls-remote https://gerrit.int.com/PubliclyAvailable
bca8486745a457ebae93f84ad7408628a9f60240 HEAD
bca8486745a457ebae93f84ad7408628a9f60240 refs/meta/config