Skip to content

v2.8.1: Stash entries no longer shared across linked worktrees

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Oct 10:33
· 4 commits to main since this release
Immutable release. Only release title and notes can be modified.
2e06ed1

hk 2.8.1 stops pre-commit hooks in different linked worktrees from taking each other's stash entries, and lets those hooks run in parallel. It also removes a deprecation warning printed by the ryl_markdown builtin.

Fixed

  • Stashing is now separate for each linked worktree (#1747, @jdx). With stash = "git", hk used to put its entry on refs/stash, and every linked worktree shares that stack. A git stash pop, drop or push in one worktree could take hk's entry while a hook was running in another worktree. The hook then failed with "hk's stash entry … is no longer in the stash list", and its unstaged and untracked changes were left in a stash that the other worktree could pop. hk now keeps its entry under a private ref, refs/hk/stash/<commit-id>, which git stash never reads or writes. hk-stash.lock now lives in each worktree's own git directory, so hooks in different worktrees run in parallel. Two hk processes in the same worktree still take turns. Entries that older hk versions pushed onto git stash can still be restored or dropped. Fixes #1746.

    git stash list no longer shows hk's entries. To inspect or recover one, use its commit id:

    git for-each-ref refs/hk/stash
    git stash show -p <commit-id>
    git stash apply <commit-id>
    git update-ref -d refs/hk/stash/<commit-id>
  • ryl_markdown no longer prints a deprecation warning (#1741, @illesnagy1). The builtin ran bare ryl --markdown <paths>, which made ryl print bare ryl <paths> is deprecated. Like the ryl builtin, it now runs ryl check.

  • Nushell completions no longer print a deprecation warning on nushell 0.116 (#1749). This comes from updating usage-rs to 7.1.1, which fixes the completer generated by hk completion nu.

Full Changelog: v2.8.0...v2.8.1

💚 Sponsor hk

hk is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work.

If hk speeds up your pre-commit loop or makes linting less painful, please consider becoming an individual or company sponsor. Your support funds ongoing development and helps keep hk fast, free, and independent.