Releases: shhac/git-hunk
Releases · shhac/git-hunk
v0.12.0
Added
- Binary files (images, databases, compiled assets, etc.) are now visible in all commands — they appear as single whole-file hunks with a
(binary)marker and can be staged, unstaged, restored, committed, and stashed by hash like any other hunk - Line-spec syntax (e.g.,
hash:3-5) is rejected for binary hunks with a clear error message, since binary files have no line-level granularity
Changed
- Internal refactoring: extracted shared helpers, moved stash orchestration to
stash.zig, deduplicated git subprocess boilerplate (-473 lines net)
v0.11.1
Fixed
- Typechange diffs (file replaced by symlink or vice versa) can now be staged, unstaged, committed, stashed, and restored — previously
git hunk addfailed witherror: wrong typewhen both hunks were applied together
v0.11.0
Added
- Symlinks now display with a trailing
@suffix in all output (list, add, reset, restore, stash, commit, check) — matching thels -Fconvention — in both human and porcelain modes
Fixed
- Stashing untracked symlinks now preserves symlink mode — previously
stash popwould restore them as regular files containing the diff output instead of as symlinks
v0.10.2
Fixed
- Running
git hunkfrom a subdirectory within a repo now works correctly — previouslygit applywould create wrong index entries (e.g., stagingbar/foo.txtinstead offoo.txt) --fileargument now resolves relative to the user's current directory, matchinggitconventions (e.g.,--file ../foo.txtfrom a subdirectory correctly refers tofoo.txtat the repo root)
v0.10.1
Fixed
list --quietnow correctly suppresses output (was silently ignored)- Added
--verbose/-vand--quiet/-qto man page GLOBAL OPTIONS section - Added
--verbose/-vand--quiet/-qto all command help text (previously onlycommitdocumented them)
v0.10.0
Added
commitcommand — commit specific hunks directly without manual staging (git hunk commit <sha>... -m "message")- Uses save/restore index approach so pre-commit, commit-msg, and post-commit hooks run normally
- Existing staged changes are preserved — only specified hunks are committed
--allto commit all unstaged hunks,--fileto commit hunks in a specific file--amendto amend the previous commit with additional hunks--dry-runto preview what would be committed--ref <refspec>to commit hunks from a ref-based diff- Line specs supported (e.g.,
sha:3-5,8) for partial-hunk commits - Crash recovery: detects and restores stale index backups from interrupted commits
- 16 integration tests covering basic usage, hooks, crash recovery, and edge cases
v0.9.1
Added
--allow-emptyflag oncheckcommand — allows zero SHA arguments, useful with--exclusiveto assert no hunks exist (e.g.,check --exclusive --allow-empty --stagedasserts nothing is staged)
v0.9.0
Added
--ref <refspec>flag for diffing against arbitrary git refs- Single ref (e.g.
--ref HEAD,--ref main) diffs ref vs worktree - Range (e.g.
--ref main..HEAD) diffs between two refs - Composes with
--stagedfor ref vs index comparison - Supported on all commands except
stash - Contextual error messages when ref-based patches don't apply cleanly
- Single ref (e.g.
Fixed
- Redundant "PatchFailed" error line no longer printed after descriptive error message
v0.8.3
Fixed
- Cross-platform test compatibility: replace BSD-only
sed -i ''with portablesed -i.bak - Handle empty file diffs on Linux where git includes
---/+++lines without@@hunks - Fix default branch name assumption in merge conflict test (
git init -b main) - Use ANSI-C quoting for tab in grep pattern (GNU grep compatibility)
v0.8.2
Fixed
- Cross-platform test compatibility: replace BSD-only
sed -i ''with portablesed -i.bak - Handle empty file diffs on Linux where git includes
---/+++lines without@@hunks - Fix default branch name assumption in merge conflict test (
git init -b main)