Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1335 +/- ##
=======================================
Coverage 90.05% 90.05%
=======================================
Files 80 80
Lines 15910 15915 +5
=======================================
+ Hits 14328 14333 +5
Misses 1582 1582 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: -0.60% (16.7 MiB → 16.6 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes the hook execution logic by avoiding unnecessary git diff operations when all hooks in a priority group are skipped. This improves performance by reducing file system operations.
Changes:
- Added logic to skip
git diffwhen all hooks in a group are skipped (DryRun, NoFiles, or Unimplemented status) - Changed semaphore from
ArctoRcfor better performance in single-threaded async context - Added
is_skipped()helper method toRunStatusenum - Minor optimizations: removed redundant
success = falseassignment and changed tosort_unstable_by
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 20, 2026
Add integration tests to verify that prek handles skipped hooks correctly. These tests serve as regression tests for j178#1335, which fixed unnecessary `git diff` calls when all hooks in a group are skipped. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across different priority groups Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 20, 2026
Add integration tests to verify that prek handles skipped hooks correctly. These tests serve as regression tests for j178#1335, which fixed unnecessary `git diff` calls when all hooks in a group are skipped. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across different priority groups Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 20, 2026
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across different priority groups Includes regression test for j178#1335: verifies that `git diff` is not called to check for file modifications when all hooks in a priority group are skipped. Uses a git wrapper script to count diff invocations. Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 20, 2026
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across different priority groups Includes regression test for j178#1335: verifies that `git diff` is not called to check for file modifications when all hooks in a priority group are skipped. Uses a git wrapper script to count diff invocations. Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 20, 2026
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across different priority groups Includes regression test for j178#1335: verifies that `git diff` is not called to check for file modifications when all hooks in a priority group are skipped. Uses a git wrapper script to count diff invocations. Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 21, 2026
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across multiple priority groups Includes regression test for j178#1335: verifies that `git diff` is only called once (initial baseline) when all hooks skip, not once per priority group. Uses tracing output to count `get_diff` calls. Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 21, 2026
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across multiple priority groups Includes regression test for j178#1335: verifies that `git diff` is only called once (initial baseline) when all hooks skip, not once per priority group. Uses tracing output to count `get_diff` calls. Refs: j178#1327, j178#1335
shaanmajid
added a commit
to shaanmajid/prek
that referenced
this pull request
Jan 21, 2026
- uses_has_worktree_changes_when_stashed: verifies optimization is used in normal workflow and file modifications are still detected - uses_get_diff_when_all_files: verifies fallback to full diff comparison when worktree may have pre-existing changes (--all-files mode) - Update all_hooks_skipped_multiple_priority_groups to expect 0 get_diff calls (combined effect of j178#1335 fix and --quiet optimization)
j178
pushed a commit
that referenced
this pull request
Jan 22, 2026
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across multiple priority groups Includes regression test for #1335: verifies that `git diff` is only called once (initial baseline) when all hooks skip, not once per priority group. Uses tracing output to count `get_diff` calls. Refs: #1327, #1335
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #1327