path: root/scripts/create-pull-request
diff options
authorDarren Hart <>2011-05-13 12:21:57 -0700
committerRichard Purdie <>2011-05-19 23:36:14 +0100
commit3c34975414f1184a35ad8b6ca8a5303786f3475f (patch)
tree2235be49c584b42cfcffcda28b1c14fba0ee8c91 /scripts/create-pull-request
parent847fa2542aad8233d31076d8eaf4ba3168a79eae (diff)
create-pull-request: rewrite known private URLs to public URLs
Rather than requiring users to have public remotes and private remotes when their development remotes are ssh based (and therefor unsuitable for a pull request URL), rewrite the ones we know about from ssh://git@ to git://. As the remote url vary from remote to remote, do the REMOTE_REPO regex per remote. With this infrastructure in place, future patches can augment the list of known remotes for things like Git Hub, Gitorious,, etc. Signed-off-by: Darren Hart <> Acked-by: Joshua Lock <> Acked-by: Otavio Salvador <> Acked-by: Tom Rini <> Cc: Tom Rini <> Cc: Martin Jansa <> Cc: Otavio Salvador <> Cc: Richard Purdie <> Cc: Joshua Lock <>
Diffstat (limited to 'scripts/create-pull-request')
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 8f7f767b98..429421b24e 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -65,7 +65,19 @@ while getopts "b:hi:m:o:p:r:s:u:" OPT; do
echo "ERROR: git config failed to find a url for '$REMOTE'"
exit 1
- REMOTE_REPO=$(echo $REMOTE_URL | sed "s#.*/\(.*\)#\1#")
+ # Rewrite known private URLs to public URLs
+ # Determine the repository name for use in the WEB_URL later
+ case "$REMOTE_URL" in
+ ssh://*)
+ REMOTE_REPO=$(echo $REMOTE_URL | sed "s#.*/\(.*\)#\1#")
+ REMOTE_URL=${REMOTE_URL/'ssh://git@'/'git://'}
+ ;;
+ ssh://*)
+ REMOTE_REPO=$(echo $REMOTE_URL | sed "s#.*/\(.*\)#\1#")
+ REMOTE_URL=${REMOTE_URL/"ssh://git@"/"git://"}
+ ;;
+ esac
# The .git suffix is optional in the URL, drop in for the REPO