diff options
Diffstat (limited to 'scripts/create-pull-request')
| -rwxr-xr-x | scripts/create-pull-request | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request index b808146391..19b640fdb8 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request | |||
| @@ -97,28 +97,22 @@ while getopts "b:chi:m:o:p:r:s:u:" OPT; do | |||
| 97 | exit 1 | 97 | exit 1 |
| 98 | fi | 98 | fi |
| 99 | 99 | ||
| 100 | # Rewrite known private URLs to public URLs | 100 | # Rewrite private URLs to public URLs |
| 101 | # Determine the repository name for use in the WEB_URL later | 101 | # Determine the repository name for use in the WEB_URL later |
| 102 | case "$REMOTE_URL" in | 102 | case "$REMOTE_URL" in |
| 103 | ssh://git@git.pokylinux.org*) | 103 | *@*) |
| 104 | REMOTE_REPO=$(echo $REMOTE_URL | sed "s#.*/\(.*\)#\1#") | 104 | USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?" |
| 105 | REMOTE_URL=${REMOTE_URL/'ssh://git@'/'git://'} | 105 | PROTO_RE="[a-z][a-z]*://" |
| 106 | GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)" | ||
| 107 | REMOTE_URL=${REMOTE_URL%.git} | ||
| 108 | REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\4#") | ||
| 109 | REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\3/\4#") | ||
| 106 | ;; | 110 | ;; |
| 107 | ssh://git@git.yoctoproject.org*) | 111 | *) |
| 108 | REMOTE_REPO=$(echo $REMOTE_URL | sed "s#.*/\(.*\)#\1#") | 112 | echo "WARNING: Unrecognized remote URL: $REMOTE_URL" |
| 109 | REMOTE_URL=${REMOTE_URL/"ssh://git@"/"git://"} | 113 | echo " The pull and browse URLs will likely be incorrect" |
| 110 | ;; | ||
| 111 | *ssh://git@git.openembedded.org*) | ||
| 112 | REMOTE_REPO=$(echo $REMOTE_URL | sed "s#.*/\(.*\)#\1#") | ||
| 113 | REMOTE_URL=${REMOTE_URL/"ssh://git@"/"git://"} | ||
| 114 | ;; | ||
| 115 | git@github.com:*) | ||
| 116 | REMOTE_REPO=$(echo $REMOTE_URL | sed 's#.*:\(.*\)\(\.git\)$#\1#') | ||
| 117 | REMOTE_URL=${REMOTE_URL/"git@github.com:"/"git://github.com/"} | ||
| 118 | ;; | 114 | ;; |
| 119 | esac | 115 | esac |
| 120 | # The .git suffix is optional in the URL, drop in for the REPO | ||
| 121 | REMOTE_REPO=${REMOTE_REPO%.git} | ||
| 122 | ;; | 116 | ;; |
| 123 | esac | 117 | esac |
| 124 | done | 118 | done |
| @@ -134,6 +128,7 @@ fi | |||
| 134 | 128 | ||
| 135 | 129 | ||
| 136 | # Set WEB_URL from known remotes | 130 | # Set WEB_URL from known remotes |
| 131 | WEB_URL="" | ||
| 137 | case "$REMOTE_URL" in | 132 | case "$REMOTE_URL" in |
| 138 | *git.yoctoproject.org*) | 133 | *git.yoctoproject.org*) |
| 139 | WEB_URL="http://git.yoctoproject.org/cgit.cgi/$REMOTE_REPO/log/?h=$BRANCH" | 134 | WEB_URL="http://git.yoctoproject.org/cgit.cgi/$REMOTE_REPO/log/?h=$BRANCH" |
