perf: show progress bars before expensive git status call#459
Merged
Conversation
Previously, the expensive git status operation happened before any progress bars were displayed, making hk appear frozen during startup. This reorders the initialization to: 1. Start hk progress bar (immediate feedback) 2. Start files progress bar with "Fetching git status" message 3. Run git status (now with visible progress) This provides immediate UI feedback that hk is working, improving perceived performance and user experience. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Merged
jdx
added a commit
that referenced
this pull request
Nov 22, 2025
## [1.24.1](https://github.com/jdx/hk/compare/v1.24.0..v1.24.1) - 2025-11-22 ### ⚡ Performance - show progress bars before expensive git status call by [@jdx](https://github.com/jdx) in [#459](#459) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bump to 1.24.1 with docs/templates updated and changelog noting a performance tweak (show progress bars before expensive git status). > > - **Release/Versioning**: > - Bump crate and CLI version to `1.24.1` in `Cargo.toml`, `Cargo.lock`, `hk.usage.kdl`, and `docs/cli`. > - **Docs & Examples**: > - Update all Pkl `amends/import` URLs and displayed version strings to `v1.24.1` across docs and example `.pkl` files. > - Regenerate `docs/cli/commands.json` with version `1.24.1`. > - **CLI Templates**: > - Update `init` generated `hk.pkl` to reference `v1.24.1`. > - Adjust `src/config.rs` example error message to `v1.24.1` URL. > - **Changelog**: > - Add `1.24.1` entry noting performance: show progress bars before expensive git status. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2439991. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: mise-en-dev <[email protected]>
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Nov 27, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [hk](https://github.com/jdx/hk) | minor | `1.22.0` -> `1.25.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/hk (hk)</summary> ### [`v1.25.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1250---2025-11-25) [Compare Source](jdx/hk@v1.24.1...v1.25.0) ##### 🚀 Features - add fix\_smart\_quotes builtin by [@​joonas](https://github.com/joonas) in [#​463](jdx/hk#463) ##### 🐛 Bug Fixes - Use `stage = "<JOB_FILES>"` for the builtins by [@​thejcannon](https://github.com/thejcannon) in [#​465](jdx/hk#465) - Actually makes `files` for step tests default to write keys by [@​thejcannon](https://github.com/thejcannon) in [#​464](jdx/hk#464) - remove test cleanup to prevent race conditions by [@​jdx](https://github.com/jdx) in [#​468](jdx/hk#468) ### [`v1.24.1`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1241---2025-11-22) [Compare Source](jdx/hk@v1.24.0...v1.24.1) ##### ⚡ Performance - show progress bars before expensive git status call by [@​jdx](https://github.com/jdx) in [#​459](jdx/hk#459) ### [`v1.24.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1240---2025-11-21) [Compare Source](jdx/hk@v1.23.0...v1.24.0) ##### 🚀 Features - hook stage by [@​thejcannon](https://github.com/thejcannon) in [#​448](jdx/hk#448) ##### 🐛 Bug Fixes - Pass/render `stdin` for `hk test` tests by [@​thejcannon](https://github.com/thejcannon) in [#​455](jdx/hk#455) ##### 📚 Documentation - Fix `from_ref` docstring by [@​thejcannon](https://github.com/thejcannon) in [#​454](jdx/hk#454) ##### ⚡ Performance - skip stash operations when no unstaged changes by [@​jdx](https://github.com/jdx) in [#​457](jdx/hk#457) - skip staging when jobs are skipped by conditions by [@​jdx](https://github.com/jdx) in [#​458](jdx/hk#458) ### [`v1.23.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1230---2025-11-21) [Compare Source](jdx/hk@v1.22.0...v1.23.0) ##### 🚀 Features - **(vacuum)** new builtin by [@​scop](https://github.com/scop) in [#​414](jdx/hk#414) - add --stats flag to show file counts per step by [@​jdx](https://github.com/jdx) in [#​446](jdx/hk#446) - Plumb `stage` through CLI and PKL by [@​thejcannon](https://github.com/thejcannon) in [#​442](jdx/hk#442) ##### 🐛 Bug Fixes - **(cli)** check help description by [@​scop](https://github.com/scop) in [#​439](jdx/hk#439) ##### 📚 Documentation - **(stash)** rephrase uncommitted -> unstaged by [@​scop](https://github.com/scop) in [#​451](jdx/hk#451) - re-Remove "auto" stash value by [@​thejcannon](https://github.com/thejcannon) in [#​444](jdx/hk#444) - Delete `schema.md` by [@​thejcannon](https://github.com/thejcannon) in [#​445](jdx/hk#445) - fix --fix description by [@​scop](https://github.com/scop) in [#​450](jdx/hk#450) ##### 📦️ Dependency Updates - update actions/checkout digest to [`93cb6ef`](jdx/hk@93cb6ef) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​452](jdx/hk#452) - update anthropics/claude-code-action digest to [`6902c22`](jdx/hk@6902c22) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​453](jdx/hk#453) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS4wIiwidXBkYXRlZEluVmVyIjoiNDIuMTkuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.
Summary
Improves perceived performance by showing progress bars immediately instead of appearing frozen during startup.
Problem
Previously, the expensive
git statusoperation happened before any progress bars were displayed, making hk appear frozen for several seconds during startup. Users had no indication that hk was working.Solution
Reordered the initialization sequence to:
git status(now with visible progress indicators)Impact
Test Plan
Run
hk run pre-commitand observe that progress bars appear immediately instead of after a delay.🤖 Generated with Claude Code
Note
Reorders hook run init to start hk/files progress spinners before executing
git statusfor faster perceived startup.src/hook.rs(Hook::run), starthk_progressand afile_progressspinner with message"Fetching git status"before callingrepo.status(...).git_statusretrieval moved to run after progress bars are created; no functional logic changes.Written by Cursor Bugbot for commit d71b2e3. This will update automatically on new commits. Configure here.