From 2e134da46c317669e226000b14551727bd3477d7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Aug 2015 17:12:30 +0200 Subject: don't use POD, to restore msysgit perl compatibility Change-Id: I360a6d5246e33dcf3f72bc83f2790905af8c1463 Reviewed-by: Simon Hausmann --- init-repository | 195 ++++++++++++++++++++++++-------------------------------- 1 file changed, 83 insertions(+), 112 deletions(-) (limited to 'init-repository') diff --git a/init-repository b/init-repository index 4f017318..f0407f63 100755 --- a/init-repository +++ b/init-repository @@ -39,149 +39,120 @@ use warnings; package Qt::InitRepository; -=head1 NAME - -init-repository - initialize the Qt5 repository and all submodules - -=head1 SYNOPSIS - - ./init-repository [options] - -This script may be run after an initial `git clone' of Qt5 in order to check -out all submodules. It fetches them from canonical URLs inferred from the -clone's origin. - - -=head1 OPTIONS - -B - -=over - -=item --force, -f - -Force initialization (even if the submodules are already checked out). - - -=item --force-hooks - -Force initialization of hooks (even if there are already hooks in checked out -submodules). - - -=item --quiet, -q - -Be quiet. Will exit cleanly if the repository is already initialized. - -=back - - -B - -=over - -=item --module-subset=,... - -Only initialize the specified subset of modules given as the argument. Specified -modules must already exist in .gitmodules. -The string "all" results in cloning all known modules. The default is the set of -maintained modules. -Module names may be prefixed with a dash to exclude them from a bigger set. - -=item --no-update - -Skip the `git submodule update' command. - -=item --branch - -Instead of checking out specific SHA1s, check out the submodule branches that -correspond with the current supermodule commit. -By default, this option will cause local commits in the submodules to be rebased. -With --no-update, the branches will be checked out, but their heads will not move. - -=item --ignore-submodules - -Set git config to ignore submodules by default when doing operations on the -qt5 repo, such as `pull', `fetch', `diff' etc. - -After using this option, pass `--ignore-submodules=none' to git to override -it as needed. - -=back - +sub printUsage($) +{ + my ($ex) = @_; -B + print < + --module-subset=,... + Only initialize the specified subset of modules given as the + argument. Specified modules must already exist in .gitmodules. The + string "all" results in cloning all known modules. The default is + the set of maintained modules. Module names may be prefixed with a + dash to exclude them from a bigger set. -Specify the user name for the (potentially) writable `gerrit' remote -for each module, for use with the Gerrit code review tool. + --no-update + Skip the `git submodule update' command. -If this option is omitted, the gerrit remote is created without a username -and port number, and thus relies on a correct SSH configuration. + --branch + Instead of checking out specific SHA1s, check out the submodule + branches that correspond with the current supermodule commit. By + default, this option will cause local commits in the submodules to + be rebased. With --no-update, the branches will be checked out, but + their heads will not move. + --ignore-submodules + Set git config to ignore submodules by default when doing operations + on the qt5 repo, such as `pull', `fetch', `diff' etc. -=item --alternates + After using this option, pass `--ignore-submodules=none' to git to + override it as needed. -Adds alternates for each submodule to another full qt5 checkout. This makes -this qt5 checkout very small, as it will use the object store of the -alternates before unique objects are stored in its own object store. + Repository options: -This option has no effect when using `--no-update'. + --berlin + Switch to internal URLs and make use of the Berlin git mirrors. + (Implies `--mirror'). -B This will make this repo dependent on the alternate, which is -potentially dangerous! The dependency can be broken by also using -the `--copy-objects' option, or by running C in each -submodule, where required. Please read the note about the `--shared' option -in the documentation of `git clone' for more information. + --oslo + Switch to internal URLs and make use of the Oslo git mirrors. + (Implies `--mirror'). + --codereview-username + Specify the user name for the (potentially) writable `gerrit' remote + for each module, for use with the Gerrit code review tool. -=item --copy-objects + If this option is omitted, the gerrit remote is created without a + username and port number, and thus relies on a correct SSH + configuration. -When `--alternates' is used, automatically do a C in each -submodule after cloning, to ensure that the repositories are independent -from the source used as a reference for cloning. + --alternates + Adds alternates for each submodule to another full qt5 checkout. + This makes this qt5 checkout very small, as it will use the object + store of the alternates before unique objects are stored in its own + object store. -Note that this negates the disk usage benefits gained from the use of -`--alternates'. + This option has no effect when using `--no-update'. + NOTE: This will make this repo dependent on the alternate, which is + potentially dangerous! The dependency can be broken by also using + the `--copy-objects' option, or by running "git repack -a" in each + submodule, where required. Please read the note about the `--shared' + option in the documentation of `git clone' for more information. -=item --mirror + --copy-objects + When `--alternates' is used, automatically do a "git repack -a" in + each submodule after cloning, to ensure that the repositories are + independent from the source used as a reference for cloning. -Uses as the base URL for submodule git mirrors. + Note that this negates the disk usage benefits gained from the use + of `--alternates'. -For example: + --mirror + Uses as the base URL for submodule git mirrors. - --mirror user@machine:/foo/bar/ + For example: -...will use the following as a mirror for qtbase: + --mirror user\@machine:/foo/bar/ - user@machine:/foo/bar/qt/qtbase.git + ...will use the following as a mirror for qtbase: -The mirror is permitted to contain a subset of the submodules; any -missing modules will fall back to the canonical URLs. + user\@machine:/foo/bar/qt/qtbase.git -=back + The mirror is permitted to contain a subset of the submodules; any + missing modules will fall back to the canonical URLs. -=cut +EOF + exit($ex); +} use Carp qw( confess ); use English qw( -no_match_vars ); use Getopt::Long qw( GetOptions ); -use Pod::Usage qw( pod2usage ); use Cwd qw( getcwd ); my $GERRIT_SSH_BASE @@ -250,7 +221,7 @@ sub parse_arguments 'update!' => \$self->{qw{ update }}, 'module-subset=s' => \$self->{qw{ module-subset }}, - 'help|?' => sub { pod2usage(1); }, + 'help|?' => sub { printUsage(1); }, 'berlin' => sub { $self->{'mirror-url'} = $BER_MIRROR_URL_BASE; @@ -258,7 +229,7 @@ sub parse_arguments 'oslo' => sub { $self->{'mirror-url'} = $OSLO_MIRROR_URL_BASE; }, - ) || pod2usage(2); + ) || printUsage(2); # Replace any double trailing slashes from end of mirror $self->{'mirror-url'} =~ s{//+$}{/}; -- cgit v1.2.3