Think of a utility like gerrit-sh which uses git config options to determine where the gerrit host is located. The context for my question is this function get_repo_remote_config(). So I want to retrieve the repository and more important the host name of the git URL configured in .git/config.The method assumes you have your username, host, port and repo all inside your git config. Which ignores that you can use ssh aliases.What is a recommended way to eithertell the host and repo for a git URLfetch the antialiased URL based on the git URL which might contain SSH aliasesFor (1) I can think of splitting on the first : or / with some additional magic.For (2) I could think of something like in this question: awk.Both approaches would work, but isn't there a more convenient way to do that? Isn't there a utility for some SSH/URL calculation?Thanks in advance.
What is the recommended way to retrieve host and repository from git URL
ssh;git;url