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 --- submodule.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'submodule.c') 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")) -- cgit v1.2.1