You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When "git commit --amend" is used when no files are staged (for example, to reword a commit message), git-secrets --pre_commit_hook scans the entire working tree. This is because the scan() function is called with an empty file list.
For large repos, this causes a bad user experience; the user expects their editor to open immediately, but instead the pre-commit hook runs for multiple seconds (9 seconds in the linux kernel on my workstation), with no progress indication. If the repo contains any previously committed files that match git-secrets patterns, the editor never opens, and git-secrets' error message is displayed.
We can make the pre_commit_hook() function return immediately if there are no changed files, which should match user expectations.
The text was updated successfully, but these errors were encountered:
steadmon
added a commit
to steadmon/git-secrets
that referenced
this issue
Jul 1, 2019
When "git commit --amend" is used when no files are staged (for example,
to reword a commit message), git-secrets --pre_commit_hook scans the
entire working tree. This is because the scan() function is called with
an empty file list.
For large repos, this causes a bad user experience; the user expects
their editor to open immediately, but instead the pre-commit hook runs
for multiple seconds (9 seconds in the linux kernel on my workstation),
with no progress indication. If the repo contains any previously
committed files that match git-secrets patterns, the editor never opens,
and git-secrets' error message is displayed.
We can make the pre_commit_hook() function return immediately if there
are no changed files, which should match user expectations.
Closesawslabs#129
When "git commit --amend" is used when no files are staged (for example, to reword a commit message), git-secrets --pre_commit_hook scans the entire working tree. This is because the scan() function is called with an empty file list.
For large repos, this causes a bad user experience; the user expects their editor to open immediately, but instead the pre-commit hook runs for multiple seconds (9 seconds in the linux kernel on my workstation), with no progress indication. If the repo contains any previously committed files that match git-secrets patterns, the editor never opens, and git-secrets' error message is displayed.
We can make the pre_commit_hook() function return immediately if there are no changed files, which should match user expectations.
The text was updated successfully, but these errors were encountered: