Atlassian Stash uses repo URLs for cloning/pushing/pulling in the form of
https://mystashserver/scm/myproject/myrepo.git
How can I transform this URL into the one used by Stash's web UI in the form of
https://mystashserver/projects/myproject/repos/myrepo
Opening the first URL in the browser automatically forwards to the latter, but you can't add additional parameters, e.g. for selecting a specific branch.
I'm looking for a way to transform URLs of the first kind to the latter, ideally for use in a Bash script.