From 4cbe91304a5d1cbd26bffc0fb65333670a068de4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 9 Nov 2011 15:59:24 +0100 Subject: always make ssh-based gerrit remotes there is no point in making read-only gerrit remotes. use gitorious for that. instead, create remotes which rely on proper ssh configuration if --codereview-username is not passed. Change-Id: I08812fd26f1de6df22cd952211f620f36f069e51 Sanity-Review: Qt Sanity Bot Reviewed-by: Rohan McGovern --- init-repository | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/init-repository b/init-repository index fcb05f67..396b42ed 100755 --- a/init-repository +++ b/init-repository @@ -150,14 +150,11 @@ The `--http' option does not affect the gerrit remotes. =item --codereview-username -Adds a (potentially) writable remote named `gerrit' for each module, -for use with the Gerrit code review tool. -This requires a username for SSH access to the codereview.qt-project.org -server, which will be the same username you have for the bugtracker at -bugreports.qt.nokia.com. +Specify the user name for the (potentially) writable `gerrit' remote +for each module, for use with the Gerrit code review tool. -If this option is omitted, the gerrit remote is created with read-only -access (using HTTP protocol). +If this option is omitted, the gerrit remote is created without a username +and port number, and thus relies on a correct SSH configuration. =item --alternates @@ -257,10 +254,7 @@ my %PROTOCOL_REPOS = ( ); my $GERRIT_SSH_BASE - = 'ssh://codereview.qt-project.org:29418/'; - -my $GERRIT_HTTP_BASE - = 'http://codereview.qt-project.org/p/'; + = 'ssh://@USER@codereview.qt-project.org@PORT@/'; my $BNE_MIRROR_URL_BASE = 'git://bq-git.apac.nokia.com/qtsoftware/'; @@ -529,14 +523,16 @@ sub git_add_remotes if ($gerrit_repo_basename && !$current_remotes{'gerrit'}) { my $gerrit_repo_url; - # If given a username, we use writable remote (ssh). - # Otherwise, we use read-only (http). + # If given a username, make a "verbose" remote. + # Otherwise, rely on proper SSH configuration. if ($self->{'codereview-username'}) { $gerrit_repo_url = $GERRIT_SSH_BASE; - $gerrit_repo_url =~ s[^ssh://][ssh://$self->{'codereview-username'}@]; + $gerrit_repo_url =~ s,\@USER\@,$self->{'codereview-username'}\@,; + $gerrit_repo_url =~ s,\@PORT\@,:29418,; } else { - $gerrit_repo_url = $GERRIT_HTTP_BASE; + $gerrit_repo_url = $GERRIT_SSH_BASE; + $gerrit_repo_url =~ s,\@[^\@]+\@,,g; } $gerrit_repo_url .= $gerrit_repo_basename; -- cgit v1.2.3