pre-commit/pre_commit/commands
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
..
__init__.py Move commands into their own files. 2014-06-13 19:52:14 -07:00
autoupdate.py remove DOTALL on REV_LINE_RE 2020-11-06 14:36:43 -08:00
clean.py Add types to pre-commit 2020-01-12 10:15:01 -08:00
gc.py Add types to pre-commit 2020-01-12 10:15:01 -08:00
hook_impl.py add support for post-commit 2020-04-27 10:55:22 -07:00
init_templatedir.py add init-templatedir --no-allow-missing-config 2020-07-20 19:02:35 -07:00
install_uninstall.py drop python.exe extension on windows on shebang 2020-09-09 12:42:48 -07:00
migrate_config.py Merge pull request #1684 from pre-commit/migrate_config_less_work 2020-11-05 16:27:23 -08:00
run.py Improve performance by ignoring submodules 2020-11-19 23:26:05 -06:00
sample_config.py Update pre-commit version in sample config 2020-09-27 14:54:42 -07:00
try_repo.py Replace aspy.yaml with sort_keys=False 2020-01-31 17:18:59 -08:00