From 0342f6c5be6fd8e14651a8ac2877c83a4a7ae097 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Mon, 19 Aug 2013 09:29:47 +0200 Subject: 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 --- init-repository.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'init-repository.py') 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' -- cgit v1.2.3