From: Mike Frysinger Date: Wed, 1 Feb 2023 16:40:33 +0000 (-0500) Subject: vcs-url: add more dynamic lookup X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b6a5680015da34528792c8712f12464bdc67810f;p=home.git vcs-url: add more dynamic lookup --- diff --git a/.bin/vcs-url b/.bin/vcs-url index 8b05986..e743c9c 100755 --- a/.bin/vcs-url +++ b/.bin/vcs-url @@ -71,6 +71,12 @@ git_url() { remote=$(git config "branch.${branch}.remote") if [[ -n ${remote} ]] ; then remote=$(git config "remote.${remote}.url") + else + # Still try harder. + local remotes=$(git config --get-regexp 'remote\..*\.url') + if [[ -n ${remotes} ]]; then + remote=$(echo "${remotes}" | awk '{print $2; exit}') + fi fi fi @@ -135,7 +141,7 @@ git_url() { url="https://git.kernel.org/${repo}.git/commit/?id=" ;; *) - echo "Unknown remote: ${remote}" + echo "Unknown remote: '${remote}'" exit 1 ;; esac