summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2010-08-05 10:49:55 +0200
committerJunio C Hamano <gitster@pobox.com>2010-08-09 09:11:50 -0700
commitbe4f2b408e5a00d123a0ecb04b0c6c48be71dfa1 (patch)
tree500bc5a6661108fe40347f0b1f38336977790f4e /submodule.c
parent302ad7a9930a34413418b6436f96826070367647 (diff)
downloadgit-be4f2b408e5a00d123a0ecb04b0c6c48be71dfa1.tar.gz
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c
index dc0f95b73f..7f0da48bc2 100644
--- a/submodule.c
+++ b/submodule.c
@@ -123,6 +123,10 @@ int parse_submodule_config_option(const char *var, const char *value)
void handle_ignore_submodules_arg(struct diff_options *diffopt,
const char *arg)
{
+ DIFF_OPT_CLR(diffopt, IGNORE_SUBMODULES);
+ DIFF_OPT_CLR(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES);
+ DIFF_OPT_CLR(diffopt, IGNORE_DIRTY_SUBMODULES);
+
if (!strcmp(arg, "all"))
DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES);
else if (!strcmp(arg, "untracked"))