diff options
author | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-05-04 16:07:30 -0500 |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-05-05 10:39:06 -0500 |
commit | f47defb081eb34226d8a604641518832767e5808 (patch) | |
tree | 8c968f1841e274c65f36829001909ad6904eeb8f /init-repository | |
parent | 4816c73f93741c62094ee8c57d78c3f6e5c2bc3e (diff) |
Add -copy-objects option
Reviewed-by: axis
Diffstat (limited to 'init-repository')
-rwxr-xr-x | init-repository | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/init-repository b/init-repository index 777d98bc..3a9faaee 100755 --- a/init-repository +++ b/init-repository @@ -50,6 +50,7 @@ my $no_webkit = 0; my $no_update = 0; my $ignore_submodules = 0; my $alternates = ""; +my $detach_alternates = 0; my $mirror_url = ""; my $mirror_webkit_url = ""; @@ -103,6 +104,9 @@ sub printUsage print(" PSS:This will make this repo dependent on the alternate!\n"); print(" The dependency can be broken by running 'git repack -a'\n"); print(" in each submodule, where required.\n"); + print(" -copy-objects Copies all objects from the alternates into the individual\n"); + print(" repos, to ensure that the repositories are independent from\n"); + print(" the source used as a reference for cloning.\n"); print(" -mirror=<url> Uses <url> as the base URL for cloning submodules.\n"); print(" -mirror=user\@machine/foo/bar\n"); print(" while for example clone qtbase from\n"); @@ -143,6 +147,8 @@ while (@ARGV) { $ignore_submodules = 1; } elsif ($arg =~ /-alternates=(.*)/) { $alternates = "$1"; + } elsif ($arg eq "-copy-objects") { + $detach_alternates = 1; } elsif ($arg =~ /-mirror=(.*)/) { $mirror_url = "$1/"; $mirror_url =~ s,\/\/+$,/,; @@ -229,6 +235,12 @@ if (!$no_update) { } else { system_v("git clone $ref $url $repo"); } + if ($detach_alternates) { + chdir($repo) or die "'cd $repo' failed..."; + system_v("git repack -a"); + unlink(".git/objects/info/alternates"); + chdir("..") or die "'cd ..' failed.."; + } } } } |