Scope synthetic GIT_WORK_TREE to git commands#2356
Conversation
GIT_WORK_TREE to git commands
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2356 +/- ##
=======================================
Coverage 93.33% 93.33%
=======================================
Files 128 128
Lines 27233 27262 +29
=======================================
+ Hits 25417 25446 +29
Misses 1816 1816 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
014d796 to
1d68aa7
Compare
📦 Cargo Bloat ComparisonBinary size change: +0.00% (29.0 MiB → 29.0 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
1d68aa7 to
b5721bc
Compare
b5721bc to
3d017be
Compare
3d017be to
3d3bf14
Compare
3d3bf14 to
ea27f0b
Compare
ea27f0b to
0df9042
Compare
⚡️ Hyperfine BenchmarksSummary: 1 regressions, 1 improvements above the 10% threshold. Environment
CLI CommandsBenchmarking basic commands in the main repo:
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base --version |
2.4 ± 0.1 | 2.3 | 3.0 | 1.01 ± 0.06 |
prek-head --version |
2.4 ± 0.1 | 2.2 | 2.9 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
9.8 ± 0.1 | 9.6 | 10.4 | 1.03 ± 0.02 |
prek-head list |
9.6 ± 0.1 | 9.3 | 9.8 | 1.00 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
3.6 ± 0.1 | 3.5 | 3.8 | 1.07 ± 0.03 |
prek-head validate-config .pre-commit-config.yaml |
3.4 ± 0.1 | 3.2 | 3.5 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.8 ± 0.1 | 2.7 | 3.0 | 1.06 ± 0.03 |
prek-head sample-config |
2.6 ± 0.1 | 2.5 | 2.8 | 1.00 |
Cold vs Warm Runs
Comparing first run (cold) vs subsequent runs (warm cache):
prek run --all-files (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
76.1 ± 1.6 | 74.2 | 78.6 | 1.01 ± 0.04 |
prek-head run --all-files |
75.6 ± 2.4 | 71.9 | 79.2 | 1.00 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
76.9 ± 2.2 | 73.1 | 80.4 | 1.02 ± 0.05 |
prek-head run --all-files |
75.3 ± 3.0 | 71.6 | 80.2 | 1.00 |
Full Hook Suite
Running the builtin hook suite on the benchmark workspace:
prek run --all-files (full builtin hook suite)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
76.7 ± 2.4 | 72.1 | 81.1 | 1.02 ± 0.05 |
prek-head run --all-files |
75.3 ± 2.5 | 71.1 | 82.4 | 1.00 |
Individual Hook Performance
Benchmarking each hook individually on the test repo:
prek run trailing-whitespace --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run trailing-whitespace --all-files |
20.7 ± 0.3 | 19.9 | 21.3 | 1.02 ± 0.02 |
prek-head run trailing-whitespace --all-files |
20.3 ± 0.3 | 19.7 | 20.7 | 1.00 |
prek run end-of-file-fixer --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run end-of-file-fixer --all-files |
26.4 ± 2.0 | 24.0 | 30.0 | 1.01 ± 0.10 |
prek-head run end-of-file-fixer --all-files |
26.1 ± 1.9 | 23.9 | 30.3 | 1.00 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
8.3 ± 0.2 | 7.9 | 8.7 | 1.03 ± 0.04 |
prek-head run check-json --all-files |
8.0 ± 0.3 | 7.6 | 8.6 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
8.1 ± 0.1 | 7.9 | 8.4 | 1.04 ± 0.03 |
prek-head run check-yaml --all-files |
7.8 ± 0.2 | 7.5 | 8.1 | 1.00 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
8.1 ± 0.2 | 7.8 | 8.7 | 1.02 ± 0.04 |
prek-head run check-toml --all-files |
7.9 ± 0.2 | 7.5 | 8.5 | 1.00 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
8.0 ± 0.3 | 7.7 | 8.8 | 1.04 ± 0.05 |
prek-head run check-xml --all-files |
7.8 ± 0.2 | 7.4 | 8.4 | 1.00 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
13.6 ± 1.2 | 12.3 | 16.2 | 1.02 ± 0.12 |
prek-head run detect-private-key --all-files |
13.4 ± 1.0 | 11.7 | 15.5 | 1.00 |
prek run fix-byte-order-marker --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run fix-byte-order-marker --all-files |
18.5 ± 0.7 | 17.4 | 19.9 | 1.01 ± 0.05 |
prek-head run fix-byte-order-marker --all-files |
18.3 ± 0.6 | 17.3 | 19.5 | 1.00 |
Installation Performance
Benchmarking hook installation (fast path hooks skip Python setup):
prek install-hooks (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.9 ± 0.1 | 4.8 | 5.1 | 1.04 ± 0.03 |
prek-head install-hooks |
4.8 ± 0.1 | 4.7 | 5.0 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.9 ± 0.0 | 4.9 | 5.0 | 1.05 ± 0.03 |
prek-head install-hooks |
4.7 ± 0.1 | 4.6 | 4.9 | 1.00 |
File Filtering/Scoping Performance
Testing different file selection modes:
prek run (staged files only)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run |
39.0 ± 1.0 | 37.8 | 41.2 | 1.00 |
prek-head run |
39.4 ± 1.2 | 37.7 | 42.0 | 1.01 ± 0.04 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
8.6 ± 0.1 | 8.4 | 8.9 | 1.00 |
prek-head run --files '*.json' |
27.3 ± 44.9 | 8.3 | 159.8 | 3.16 ± 5.20 |
prek run --files '*.json' (specific file type): 216.0700% slower
Workspace Discovery & Initialization
Benchmarking hook discovery and initialization overhead:
prek run --dry-run --all-files (measures init overhead)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --dry-run --all-files |
7.5 ± 0.1 | 7.3 | 7.6 | 1.00 |
prek-head run --dry-run --all-files |
8.0 ± 0.9 | 7.1 | 9.3 | 1.07 ± 0.13 |
Meta Hooks Performance
Benchmarking meta hooks separately:
prek run check-hooks-apply --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-hooks-apply --all-files |
12.9 ± 0.1 | 12.8 | 13.1 | 1.01 ± 0.01 |
prek-head run check-hooks-apply --all-files |
12.8 ± 0.1 | 12.7 | 12.9 | 1.00 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
12.8 ± 0.8 | 11.5 | 14.1 | 1.13 ± 0.07 |
prek-head run check-useless-excludes --all-files |
11.3 ± 0.1 | 11.1 | 11.5 | 1.00 |
✅ Performance improvement for prek run check-useless-excludes --all-files: 11.6300% faster
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
10.8 ± 0.1 | 10.6 | 11.0 | 1.02 ± 0.02 |
prek-head run identity --all-files |
10.6 ± 0.2 | 10.2 | 11.2 | 1.00 |
0df9042 to
7b29e1a
Compare
Automated mise tool upgrades from local config. Updated tools: - `prek` Command: `mise upgrade --bump --local prek` <details> <summary>Version changelog (prek)</summary> | Tool | Requested | Installed | |------|-----------|-----------| | `prek` | `0.4.9` → `0.4.10` | `0.4.9` → `0.4.10` | </details> <details> <summary>Release notes (1 tools)</summary> <details> <summary>prek: `0.4.9` → `0.4.10` (j178/prek)</summary> ### v0.4.10 ## Release Notes Released on 2026-07-16. ### Enhancements - Add PHP language support ([#2314](j178/prek#2314)) - Add freeze option to update settings ([#2323](j178/prek#2323)) - Add tag filters to update configuration ([#2354](j178/prek#2354)) - Identify 'mts' and 'cts' as TypeScript files ([#2209](j178/prek#2209)) - Publish Alpine Docker images ([#2352](j178/prek#2352)) - Support builtin and meta in try-repo ([#2350](j178/prek#2350)) ### Bug fixes - Fix Python discovery order ([#2348](j178/prek#2348)) - Fix Windows progress rendering ([#2328](j178/prek#2328)) - Preserve configured repo values for updates ([#2324](j178/prek#2324)) - Scope synthetic `GIT_WORK_TREE` to git commands ([#2356](j178/prek#2356)) ### Documentation - Expand common workflows guide ([#2351](j178/prek#2351)) ### Contributors - @j178 ## Install prek 0.4.10 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.4.10/prek-installer.sh | sh ``` ### Install prebuilt binaries via powershell script ```sh powershell -ExecutionPolicy Bypass -c "irm https://github.com/j178/prek/releases/download/v0.4.10/prek-installer.ps1 | iex" ``` ### Install prebuilt binaries via Homebrew ```sh brew install prek ``` ## Download prek 0.4.10 | File | Platform | Checksum | |--------|----------|----------| | [prek-aarch64-apple-darwin.tar.gz](https://github.com/j178/prek/releases/download/v0.4.10/prek-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/j178/prek/releases/download/v0.4.10/prek-aarch64-apple-darwin.tar.gz.sha256) | | [prek-x86_64-apple-darwin.tar.gz](https://github.com/j178/prek/releases/download/v0.… (truncated) </details> </details> Modified files: - `.mise.toml` Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Keep the synthetic GIT_WORK_TREE scoped to prek-owned git commands instead of the process environment.
Closes #2248
Closes #2293