From aee9c7d6540fe6f66fbbe7be420caa26ae0fa2d9 Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Fri, 6 Aug 2010 00:39:25 +0200 Subject: Submodules: Add the new "ignore" config option for diff and status The new "ignore" config option controls the default behavior for "git status" and the diff family. It specifies under what circumstances they consider submodules as modified and can be set separately for each submodule. The command line option "--ignore-submodules=" has been extended to accept the new parameter "none" for both status and diff. Users that chose submodules to get rid of long work tree scanning times might want to set the "dirty" option for those submodules. This brings back the pre 1.7.0 behavior, where submodule work trees were never scanned for modifications. By using "--ignore-submodules=none" on the command line the status and diff commands can be told to do a full scan. This option can be set to the following values (which have the same name and meaning as for the "--ignore-submodules" option of status and diff): "all": All changes to the submodule will be ignored. "dirty": Only differences of the commit recorded in the superproject and the submodules HEAD will be considered modifications, all changes to the work tree of the submodule will be ignored. When using this value, the submodule will not be scanned for work tree changes at all, leading to a performance benefit on large submodules. "untracked": Only untracked files in the submodules work tree are ignored, a changed HEAD and/or modified files in the submodule will mark it as modified. "none" (which is the default): Either untracked or modified files in a submodules work tree or a difference between the subdmodules HEAD and the commit recorded in the superproject will make it show up as changed. This value is added as a new parameter for the "--ignore-submodules" option of the diff family and "git status" so the user can override the settings in the configuration. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- Documentation/config.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation/config.txt') diff --git a/Documentation/config.txt b/Documentation/config.txt index e75434b3e..5ca09aed9 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1743,6 +1743,16 @@ submodule..update:: URL and other values found in the `.gitmodules` file. See linkgit:git-submodule[1] and linkgit:gitmodules[5] for details. +submodule..ignore:: + Defines under what circumstances "git status" and the diff family show + a submodule as modified. When set to "all", it will never be considered + modified, "dirty" will ignore all changes to the submodules work tree and + takes only differences between the HEAD of the submodule and the commit + recorded in the superproject into account. "untracked" will additionally + let submodules with modified tracked files in their work tree show up. + Using "none" (the default when this option is not set) also shows + submodules that have untracked files in their work tree as changed. + tar.umask:: This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the -- cgit v1.2.1 From 302ad7a9930a34413418b6436f96826070367647 Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Fri, 6 Aug 2010 00:40:48 +0200 Subject: Submodules: Use "ignore" settings from .gitmodules too for diff and status The .gitmodules file is parsed for "submodule..ignore" entries before looking for them in .git/config. Thus settings found in .git/config will override those from .gitmodules, thereby allowing the local developer to ignore settings given by the remote side while also letting upstream set defaults for those users who don't have special needs. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- Documentation/config.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/config.txt') diff --git a/Documentation/config.txt b/Documentation/config.txt index 5ca09aed9..c88a63764 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1752,6 +1752,9 @@ submodule..ignore:: let submodules with modified tracked files in their work tree show up. Using "none" (the default when this option is not set) also shows submodules that have untracked files in their work tree as changed. + This setting overrides any setting made in .gitmodules for this submodule, + both settings can be overriden on the command line by using the + "--ignore-submodule" option. tar.umask:: This variable can be used to restrict the permission bits of -- cgit v1.2.1 From be4f2b408e5a00d123a0ecb04b0c6c48be71dfa1 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 5 Aug 2010 10:49:55 +0200 Subject: Add the 'diff.ignoreSubmodules' config setting When you have a lot of submodules checked out, the time penalty to check for dirty submodules can easily imply a multiplication of the total time by the factor 20. This makes the difference between almost instantaneous (< 2 seconds) and unbearably slow (> 50 seconds) here, since the disk caches are constantly overloaded. To this end, the submodule.*.ignore config option was introduced, but it is per-submodule. This commit introduces a global config setting to set a default (porcelain) value for the --ignore-submodules option, keeping the default at 'none'. It can be overridden by the submodule.*.ignore setting and by the --ignore-submodules option. Incidentally, this commit fixes an issue with the overriding logic: multiple --ignore-submodules options would not clear the previously set flags. While at it, fix a typo in the documentation for submodule.*.ignore. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/config.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation/config.txt') diff --git a/Documentation/config.txt b/Documentation/config.txt index c88a63764..cf5562192 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -826,6 +826,11 @@ diff.renames:: will enable basic rename detection. If set to "copies" or "copy", it will detect copies, as well. +diff.ignoreSubmodules:: + Sets the default value of --ignore-submodules. Note that this + affects only 'git diff' Porcelain, and not lower level 'diff' + commands such as 'git diff-files'. + diff.suppressBlankEmpty:: A boolean to inhibit the standard behavior of printing a space before each empty output line. Defaults to false. @@ -1754,7 +1759,7 @@ submodule..ignore:: submodules that have untracked files in their work tree as changed. This setting overrides any setting made in .gitmodules for this submodule, both settings can be overriden on the command line by using the - "--ignore-submodule" option. + "--ignore-submodules" option. tar.umask:: This variable can be used to restrict the permission bits of -- cgit v1.2.1