github jdx/hk v1.43.0
v1.43.0: Stdin forwarding, harper builtin, and musl binaries

14 hours ago

This release adds {{ hook_stdin }} for forwarding git hook stdin to step commands (completing git-lfs support started in v1.42.0), introduces a built-in harper grammar checker, and ships Linux musl binaries for Alpine and other musl-based distributions.

Highlights

  • {{ hook_stdin }} template variable completes git-lfs pre-push support -- LFS objects are now properly uploaded during git push
  • harper-cli builtin adds grammar checking as a first-class linter
  • Linux musl release binaries for Alpine and other musl-based distros
  • hk is back on crates.io -- installable via cargo install hk again

Added

  • {{ hook_stdin }} template variable: Step commands can now receive the raw stdin that git passes to hook scripts via the stdin field. This is essential for git lfs pre-push, which needs the ref data piped through stdin to know which LFS objects to upload. Without this, git lfs pre-push would silently succeed but upload nothing, causing the remote to reject the push. The variable is available in pre-push and post-rewrite hooks. (@JohanLorenzo) #825

    hooks {
        ["pre-push"] {
            steps {
                ["git-lfs"] {
                    check = "git lfs pre-push {{ hook_args }}"
                    stdin = "{{ hook_stdin }}"
                }
            }
        }
    }

    For pre-push, {{ hook_stdin }} contains the ref lines that git pipes in (e.g., refs/heads/main <local-sha> refs/heads/main <remote-sha>). For post-rewrite, it contains the old/new SHA mapping lines. When stdin is a terminal (no piped data), it expands to an empty string.

  • Built-in harper and harper_commit_message linter steps: harper-cli is now available as a builtin linter for grammar checking prose and documentation. The harper step runs against text files, while harper_commit_message checks commit messages. (@hituzi-no-sippo) #714

  • Linux musl release binaries: Pre-built binaries for x86_64-unknown-linux-musl and aarch64-unknown-linux-musl are now included in releases, making hk easy to install on Alpine Linux and other musl-based distributions. (@jdx) #829

  • hk is published to crates.io again: The crate had been stuck at v1.10.1 since August 2025 after the publish step was accidentally dropped during a build system migration. Starting with this release, cargo install hk will get the latest version. (@jdx) #830

New Contributors

Full Changelog: v1.42.0...v1.43.0

Don't miss a new hk release

NewReleases is sending notifications on new releases.