pre-commit/pre_commit
Michael Vincent 120d60223a Improve performance by ignoring submodules
When git status runs in a repo with submodules, it'll recursively run
git status in every submodule as well by default (sequentially).
git status is substantially slower on Windows than on Linux. git diff
behaves similarly to git status in terms of running recursively within
all submodules. In repos with hundreds of submodules, this quickly adds
up when git status/diff are called multiple times. Pre-commit runs
git status once at the beginning of an operation and then runs git diff
before and after each hook. These calls quickly add up and make
pre-commit unusable in large repos with lots of submodules.

This commit drastically improves performance in repos with lots of
submodules and fixes #1701 by telling git status and git diff to ignore
submodules. This change is not expected to have any negative effect on
existing hooks because each submodule should manage its own hooks
instead of relying on superproject hooks to manipulate their contents.
2020-11-19 23:26:05 -06:00
..
commands Improve performance by ignoring submodules 2020-11-19 23:26:05 -06:00
languages fix for rbenv used outside of pre-commit and language_version: default 2020-11-17 11:58:46 -08:00
meta_hooks add types_or 2020-11-02 17:25:10 +00:00
resources update rbenv / ruby-build 2020-09-22 23:03:01 -07:00
__init__.py Initial commit. 2014-03-12 20:25:19 -07:00
__main__.py upgrade hooks, pyupgrade pre-commit 2020-01-12 09:27:04 -08:00
clientlib.py add types_or 2020-11-02 17:25:10 +00:00
color.py warn on old list-style configuration 2020-07-25 13:04:54 -07:00
constants.py add support for post-commit 2020-04-27 10:55:22 -07:00
envcontext.py use slightly simpler enum syntax 2020-11-09 12:29:57 -08:00
error_handler.py Distinct error handling exit codes 2020-10-28 11:13:04 -07:00
errors.py check cygwin mismatch earlier 2020-09-20 10:42:11 -07:00
file_lock.py upgrade mypy to get typeshed fixes 2020-07-08 13:55:28 -07:00
git.py Improve performance by ignoring submodules 2020-11-19 23:26:05 -06:00
hook.py add types_or 2020-11-02 17:25:10 +00:00
logging_handler.py Some manual .format() -> f-strings 2020-01-12 13:39:53 -08:00
main.py check cygwin mismatch earlier 2020-09-20 10:42:11 -07:00
make_archives.py update rbenv / ruby-build 2020-09-22 23:03:01 -07:00
output.py More miscellaneous cleanup 2020-01-13 11:47:34 -08:00
parse_shebang.py Use covdefaults to handle coveragerc 2020-02-29 14:25:19 -08:00
prefix.py Add types to pre-commit 2020-01-12 10:15:01 -08:00
repository.py fix atomic file replace on windows 2020-08-23 10:18:59 -07:00
staged_files_only.py fix hooks firing during staged_files_only 2020-05-02 14:00:21 -07:00
store.py fix atomic file replace on windows 2020-08-23 10:18:59 -07:00
util.py Replace EnvironT with MutableMapping[str, str] 2020-10-28 13:00:25 -07:00
xargs.py improve xargs when running windows batch files 2020-11-06 13:09:01 -08:00