Anthony Sottile
8cfe8e590d
don't crash on cygwin mismatch check
2020-11-28 15:20:14 -08:00
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
Anthony Sottile
24dfeed89c
Replace EnvironT with MutableMapping[str, str]
2020-10-28 13:00:25 -07:00
Anthony Sottile
91530f1005
check cygwin mismatch earlier
2020-09-20 10:42:11 -07:00
Anthony Sottile
6ee9e13b26
prevent infinite recursion of post-checkout on clone
2020-06-09 10:18:22 -07:00
Anthony Sottile
d35b00352f
Make more readable --from-ref / --to-ref aliases for --source / --origin
2020-02-23 11:07:57 -08:00
Michael Schier
d9800ad95a
exclude GIT_SSL_NO_VERIFY env variable from getting stripped
2020-01-21 15:17:03 -08:00
Anthony Sottile
df40e862f4
More miscellaneous cleanup
2020-01-13 11:47:34 -08:00
Anthony Sottile
9000e9dd41
Some manual .format() -> f-strings
2020-01-12 13:39:53 -08:00
Anthony Sottile
aefbe71765
Clean up calls to .encode() / .decode()
2020-01-12 10:46:33 -08:00
Anthony Sottile
327ed924a3
Add types to pre-commit
2020-01-12 10:15:01 -08:00
Anthony Sottile
30c1e8289f
upgrade hooks, pyupgrade pre-commit
2020-01-12 09:27:04 -08:00
Anthony Sottile
968b2fdaf1
Allow try-repo to work on bare repositories
2019-12-30 11:00:45 -08:00
Ivan Gankevich
8c93896c48
Add GIT_SSL_CAINFO environment variable to whitelist.
...
This commit fixes #1253 .
2019-12-26 12:43:55 +03:00
Anthony Sottile
f612aeb22b
Split out cmd_output_b
2019-10-06 15:16:47 -07:00
Anthony Sottile
73250ff4e3
Fix autoupdate to always use non-shallow clone
2019-07-20 14:59:49 -07:00
Anthony Sottile
dc28922ccb
Run pre-commit autoupdate
...
Committed via https://github.com/asottile/all-repos
2019-03-21 21:09:33 -07:00
DanielChabrowski
888787fb2d
Fix try-repo for staged untracked changes
2019-03-18 02:04:50 +01:00
Brett Randall
f5af95cc9d
Added test for git.no_git_env().
...
Signed-off-by: Brett Randall <javabrett@gmail.com >
2019-03-18 10:23:54 +11:00
Min RK
9cde231665
respect GIT_EXEC_PATH env
...
This env may be required for git to work,
unsetting it can cause clone to fail
occurs with bundled git, e.g. Fork git client
2019-02-16 09:14:11 +01:00
Benjamin Bariteau
db04d612e0
pass GIT_SSH_COMMAND to git commands, refs #947
2019-02-15 14:37:53 -08:00
Anthony Sottile
e60579d9f3
Fix staged-files-only for git add --intent-to-add files
2019-01-08 09:28:57 -08:00
Anthony Sottile
bdc58cc33f
Teach pre-commit try-repo to clone uncommitted changes
2019-01-01 15:01:36 -08:00
Anthony Sottile
fe409f1a43
Remove stateful Runner
2018-12-26 22:33:21 -08:00
Anthony Sottile
18b6f4b519
Fix rev-parse for older git versions
2018-09-22 11:12:27 -07:00
Mickaël Schoentgen
67d6fcb0f6
Fix several ResourceWarning: unclosed file
2018-08-10 18:30:22 +02:00
Anthony Sottile
3f78487769
Support pre-commit install inside a worktree
2018-08-06 09:26:42 -07:00
Anthony Sottile
5651c66995
Migrate sha -> rev
2018-02-24 20:19:39 -08:00
Anthony Sottile
2c88791a7f
Add pre-commit try-repo
...
`try-repo` is useful for:
- Trying out a remote hook repository without needing to configure it.
- Testing a hook repository while developing it.
2017-10-07 18:03:52 -07:00
Anthony Sottile
18c9e061d8
Small cleanups
2017-09-30 15:53:44 -07:00
Anthony Sottile
6af60158ec
Refactor filename collection for hooks
2017-09-09 22:07:27 -07:00
Anthony Sottile
0815108242
Handle non-ascii filenames from git
2017-09-05 08:10:16 -07:00
Anthony Sottile
0c70fa4229
Use asottile/add-trailing-comma
2017-07-12 18:30:51 -07:00
Anthony Sottile
321210d332
Run git diff with --no-ext-diff
2017-06-09 08:34:04 -07:00
Anthony Sottile
964948b33d
Fix non-ascii merge commit messages in python2
2017-05-10 12:52:24 -07:00
Anthony Sottile
068c18d38a
Add first class support for golang hooks
2017-01-24 13:49:22 -08:00
Anthony Sottile
ba75867c93
py27+ syntax improvements
2017-01-21 11:49:53 -08:00
Anthony Sottile
526abd9251
Warn on cygwin python/git mismatch. Resolves #354
2016-11-26 14:44:29 -08:00
Anthony Sottile
a7169905dc
Centralize logging initialization
2016-11-26 14:19:37 -08:00
Sander Maijers
1d4a332e04
Clarify/correct error message
...
The error also occurs if the `git` utility isn't available.
2016-08-16 15:47:17 +02:00
Anthony Sottile
db97cf3329
Don't run on deleted files. Resolves #374
2016-05-25 08:42:02 -07:00
Benjamin Chess
a70abd04e7
include checking symlinks
2016-01-15 12:50:04 -08:00
Anthony Sottile
c3c98afe4f
Support pre-commit from inside submodules
2015-12-18 15:35:44 -08:00
Anthony Sottile
3f02a66e37
Use rev-parse --show-toplevel
2015-12-18 08:04:26 -08:00
Anthony Sottile
45d4a195ef
Environments are now installed to version-specific locations. Resolves #229
2015-05-16 18:51:14 -07:00
Anthony Sottile
143ed94500
Tests pass on windows
2015-02-27 00:48:01 -08:00
Anthony Sottile
bbd2572b11
Remove plumbum
2014-10-02 06:59:37 -07:00
Anthony Sottile
e3d29a897b
Make git errors throw FatalError
2014-08-13 10:43:32 -07:00
Anthony Sottile
85a76617c1
Refactor fixtures in tests.
2014-06-15 18:49:45 -07:00
Anthony Sottile
7b1230df27
Use plumbum a bit better.
2014-06-15 14:19:05 -07:00