This release adds support for per-worktree git hook configurations, fixes the global config path to consistently use XDG_CONFIG_HOME across all platforms, and resolves a common issue where Go package-level analysis tools would fail in multi-package projects.
Added
-
Per-worktree hook support: When
extensions.worktreeConfigis enabled and a per-worktreecore.hooksPathis set,hk installandhk uninstallnow respect that worktree-local directory instead of always using the shared hooks directory. This allows different worktrees to have independent hook configurations without conflicting with each other. (@nkakouros) #789# Enable per-worktree config in the main repo git config extensions.worktreeConfig true # In each worktree, point hooks to a worktree-local directory cd /path/to/worktree git config --worktree core.hooksPath "$(git rev-parse --git-dir)/hooks" hk install
Fixed
-
Config path now uses
XDG_CONFIG_HOMEon all platforms: Previously, hk useddirs::config_dir()which resolves to~/Library/Application Support/on macOS, meaning the documented path~/.config/hk/config.pklwould not be found. hk now uses$XDG_CONFIG_HOME(defaulting to~/.config) on all platforms, consistent with mise and matching what the documentation describes. (@fukuchancat) #801 -
Go package-level builtins work in multi-package projects: Seven Go analysis builtins (
go_vet,golangci_lint,go_sec,go_vuln_check,staticcheck,revive,err_check) now useworkspace_indicator = "go.mod"and run./...from the module root instead of passing individual file paths. This fixes the "named files must all be in one directory" error that occurred when staged.gofiles spanned multiple packages -- a Go toolchain constraint that affects any tool built ongo/packages. File-level formatters (go_fmt,go_fumpt,go_imports,go_lines) are unchanged. (@jdx) #803
Breaking Changes
- macOS config path changed: On macOS, hk now looks for global config at
~/.config/hk/config.pklinstead of~/Library/Application Support/hk/config.pkl. If you had a config file at the old macOS-specific path, move it to~/.config/hk/config.pkl(or setHK_CONFIG_DIRto point to your preferred location). This was never documented or intended behavior.
New Contributors
- @fukuchancat made their first contribution in #801
Full Changelog: v1.40.0...v1.41.0