You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/03/20 15:00:44 UTC

[sling-tooling-scm] 35/35: jira_link_for_commit - add support for SSH remotes

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-tooling-scm.git

commit d32fbbd610e494da19c2f20846868e677ee962e0
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Mar 20 15:59:42 2019 +0100

    jira_link_for_commit - add support for SSH remotes
---
 scripts/jira_link_for_commit.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/jira_link_for_commit.sh b/scripts/jira_link_for_commit.sh
index 862b633..30dae40 100755
--- a/scripts/jira_link_for_commit.sh
+++ b/scripts/jira_link_for_commit.sh
@@ -8,6 +8,8 @@ fi
 hash=$(git rev-parse --short ${commit})
 base=$(git remote get-url origin)
 url=${base%.git}/commit/${hash}
-repo_name=$(echo $base | awk -F '/' '{ gsub(".git", "", $5); print $5}')
+url=${url/git@/https://}
+url=${url/.com:/.com/}
+repo_name=$(echo $base | awk -F '/' '{ gsub(".git", "", $NF); print $NF}')
 
 echo "[${repo_name} commit ${hash}|${url}]"