Skip to content

Commit

Permalink
nuke the --http option
Browse files Browse the repository at this point in the history
it was a vestige from the times when the submodules had absolute urls
pointing at git://gitorious.org. as we now use relative urls, things
work just fine without that option.

Change-Id: I5e93ff8cd2497a27cfbdd53dbcf9db3cd0c4cd1d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
  • Loading branch information
ossilator committed Sep 23, 2014
1 parent b2e5779 commit 93f173b
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions init-repository
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ Switch to internal URLs and make use of the Oslo git mirrors.
(Implies `--mirror').
=item --http
Use the HTTP protocol for git operations. This may be useful if the git
protocol is blocked by a firewall. Note that this only works with the
external Gitorious server.
The `--http' option does not affect the gerrit remotes.
=item --codereview-username <Gerrit/JIRA username>
Specify the user name for the (potentially) writable `gerrit' remote
Expand Down Expand Up @@ -199,10 +190,6 @@ use Getopt::Long qw( GetOptionsFromArray );
use Pod::Usage qw( pod2usage );
use Cwd qw( getcwd );

my %PROTOCOLS = (
'http' => 'http://git.gitorious.org/' ,
);

my %GERRIT_REPOS = map { $_ => "qt/$_" } qw(
qt3d
qt5
Expand Down Expand Up @@ -326,7 +313,6 @@ sub parse_arguments
'force-hooks' => 0 ,
'ignore-submodules' => 0 ,
'mirror-url' => "",
'protocol' => "",
'update' => 1 ,
'webkit' => 1 ,
'module-subset' => join(",", @DEFAULT_REPOS),
Expand All @@ -346,7 +332,6 @@ sub parse_arguments
'module-subset=s' => \$self->{qw{ module-subset }},

'help|?' => sub { pod2usage(1); },
'http' => sub { $self->{protocol} = 'http'; },

'berlin' => sub {
$self->{'mirror-url'} = $BER_MIRROR_URL_BASE;
Expand Down Expand Up @@ -442,27 +427,14 @@ sub git_set_submodule_config
{
my ($self) = @_;

my @configresult = qx(git config -l);
my $protocol = $self->{protocol};
my $url_base_for_protocol = $PROTOCOLS{$protocol};
return unless ($self->{'ignore-submodules'});

my @configresult = qx(git config -l);
foreach my $line (@configresult) {
# Example line: submodule.qtqa.url=git://gitorious.org/qt/qtqa.git
next if ($line !~ /submodule\.([^.=]+)\.url=(.*)/);

my $key = $1;
my $value = $2;

if ($protocol) {
# rewrite URL to chosen protocol
$value =~ s,^git://gitorious\.org/,$url_base_for_protocol,;
}

$self->exe('git', 'config', "submodule.$key.url", $value);

if ($self->{'ignore-submodules'}) {
$self->exe('git', 'config', "submodule.$key.ignore", 'all');
}
$self->exe('git', 'config', "submodule.$1.ignore", 'all');
}

return;
Expand Down

0 comments on commit 93f173b

Please sign in to comment.