diff options
author | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-05-04 12:45:05 -0500 |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-05-05 10:38:40 -0500 |
commit | 610962ed0733550677d4a8abe78a728abf889c52 (patch) | |
tree | eda74aaabd3d6d0a0dbba70d2031dc605950d4e5 /init-repository | |
parent | 30960ad5b83a0eceeddc95ccdb002013187b2669 (diff) |
Add -ignore-submodules option
Will make 'diff', 'fetch', 'pull' etc ignore the submodules
by default. You can still use --ignore-submodules=none to
override this, when really needed.
Very convenient when working with staging repos, instead of
what the qt5 repo dictate as the current module SHA1.
Reviewed-by: axis
Diffstat (limited to 'init-repository')
-rwxr-xr-x | init-repository | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/init-repository b/init-repository index fc492edd..745fabe9 100755 --- a/init-repository +++ b/init-repository @@ -50,6 +50,8 @@ my $brisbane_mirror = 0; my $ssh_protocol = 0; my $no_webkit = 0; my $no_update = 0; +my $ignore_submodules = 0; + sub system_v { @@ -73,6 +75,11 @@ sub printUsage print("\ta user account with an uploaded SSH key on all servers used.\n"); print("-no-webkit\n\tSkip webkit and webkit examples submodules.\n"); print("-no-update\n\t Skip the git submodule update command.\n"); + print(" -ignore-submodules\n"); + print(" Ignores submodules when doing operations on qt5 repo, such\n"); + print(" as 'pull', 'fetch', 'diff' etc. Use\n"); + print(" --ignore-submodules=none to override, when needed\n\n"); + } while (@ARGV) { @@ -95,6 +102,8 @@ while (@ARGV) { $no_webkit = 1; } elsif ($arg eq "-no-update") { $no_update = 1; + } elsif ($arg eq "-ignore-submodules") { + $ignore_submodules = 1; } else { print("*** Unknown option: $arg\n"); printUsage(); @@ -143,6 +152,10 @@ foreach (@configresult) { $value =~ s,git://([^/:]+)/(.*),git\@$1:$2,; } system_v("git config \"$key\" \"$value\""); + if ($ignore_submodules) { + $key =~ s,\.url,.ignore,; + system_v("git config \"$key\" \"all\""); + } } } |