diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-19 09:29:47 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-19 20:27:25 +0200 |
commit | 0342f6c5be6fd8e14651a8ac2877c83a4a7ae097 (patch) | |
tree | 3be30ef0530803f5167f56cd625ea55e94aea81f | |
parent | fada4c705acff45be8418f20d28f1a091e6afe47 (diff) |
Make sure submodule changes do not show up as a diff.
This is needed to prevent .gitmodules changes
from showing up when using the upstream repositories.
It will also prevent changes in submodules from showing
up and being added to a commit by accident.
Change-Id: Ia74f59ebce6d458b39c6ca2472aa6e623cd280fd
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rwxr-xr-x | init-repository.py | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/init-repository.py b/init-repository.py index 5cd3dfb02..cc853a80d 100755 --- a/init-repository.py +++ b/init-repository.py @@ -113,30 +113,15 @@ def initUpstreamSubmodules(): chromium_shasum = '29d2d710e0e7961dff032ad4ab73887cc33122bb' os.chdir(qtwebengine_src) + print 'Configuring git to ignore all submodules. Submodule changes will not show up in "git diff"!' + subprocess.call(['git', 'config', 'diff.ignoreSubmodules', 'all']) + subprocess.call(['git', 'update-index', '--assume-unchanged', '.gitmodules']) + current_submodules = subprocess.check_output(['git', 'submodule']) if not '3rdparty_upstream/ninja' in current_submodules: subprocess.call(['git', 'submodule', 'add', ninja_url, '3rdparty_upstream/ninja']) - gitmodules_file = open('.gitmodules', 'a') - gitmodules_file.writelines([' ignore = all\n']) - gitmodules_file.close() if not '3rdparty_upstream/chromium' in current_submodules: subprocess.call(['git', 'submodule', 'add', chromium_url, '3rdparty_upstream/chromium']) - gitmodules_file = open('.gitmodules', 'a') - gitmodules_file.writelines([' ignore = all\n']) - gitmodules_file.close() - - gitignore_file = open('.gitignore') - gitignore_content = gitignore_file.readlines() - gitignore_file.close() - - gitmodules_is_ignored = False - for gitignore_line in gitignore_content: - if '.gitmodules' in gitignore_line: - gitmodules_is_ignored = True - if not gitmodules_is_ignored: - gitignore_file = open('.gitignore', 'a') - gitignore_file.writelines(['.gitmodules\n']) - gitignore_file.close() ninjaSubmodule = GitSubmodule.Submodule() ninjaSubmodule.path = '3rdparty_upstream/ninja' |