From b6a5680015da34528792c8712f12464bdc67810f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 1 Feb 2023 11:40:33 -0500 Subject: [PATCH] vcs-url: add more dynamic lookup --- .bin/vcs-url | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.2