[RFC,04/10] create-pull-request: rewrite known private URLs to public URLs

Submitted by Darren Hart on May 13, 2011, 11:37 p.m. | Patch ID: 4005


Message ID 5be48b04615bb47fff1607df2ec1d33e33cf2aa7.1305329659.git.dvhart@linux.intel.com
State New, archived
Headers show

Commit Message

Darren Hart May 13, 2011, 11:37 p.m.
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://.

With this infrastructure in place, future patches can augment the list of
known remotes for things like Git Hub, Gitorious, kernel.org, etc.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Tom Rini <tom_rini@mentor.com>
Cc: Martin Jansa <martin.jansa@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
 scripts/create-pull-request |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index c6cf817..96cf04f 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -65,6 +65,16 @@  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
+		# Rewrite known private URLs to public URLs
+		case "$REMOTE_URL" in
+		*ssh://git@git.pokylinux.org*)
+			REMOTE_URL=${REMOTE_URL/'ssh://git@'/'git://'}
+			;;
+		*ssh://git@git.yoctoproject.org*)
+			REMOTE_URL=${REMOTE_URL/"ssh://git@"/"git://"}
+			;;
+		esac