Skip to content

Releases: shhac/git-hunk

v0.12.0

11 Apr 02:23
b500ebb

Choose a tag to compare

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

09 Apr 16:10
0ad7ff6

Choose a tag to compare

Fixed

  • Typechange diffs (file replaced by symlink or vice versa) can now be staged, unstaged, committed, stashed, and restored — previously git hunk add failed with error: wrong type when both hunks were applied together

v0.11.0

26 Mar 15:23
3896bcb

Choose a tag to compare

Added

  • Symlinks now display with a trailing @ suffix in all output (list, add, reset, restore, stash, commit, check) — matching the ls -F convention — in both human and porcelain modes

Fixed

  • Stashing untracked symlinks now preserves symlink mode — previously stash pop would restore them as regular files containing the diff output instead of as symlinks

v0.10.2

11 Mar 02:23
98a5dc2

Choose a tag to compare

Fixed

  • Running git hunk from a subdirectory within a repo now works correctly — previously git apply would create wrong index entries (e.g., staging bar/foo.txt instead of foo.txt)
  • --file argument now resolves relative to the user's current directory, matching git conventions (e.g., --file ../foo.txt from a subdirectory correctly refers to foo.txt at the repo root)

v0.10.1

03 Mar 22:29
a755f2c

Choose a tag to compare

Fixed

  • list --quiet now correctly suppresses output (was silently ignored)
  • Added --verbose/-v and --quiet/-q to man page GLOBAL OPTIONS section
  • Added --verbose/-v and --quiet/-q to all command help text (previously only commit documented them)

v0.10.0

03 Mar 18:55
f3ae88a

Choose a tag to compare

Added

  • commit command — 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
    • --all to commit all unstaged hunks, --file to commit hunks in a specific file
    • --amend to amend the previous commit with additional hunks
    • --dry-run to 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

03 Mar 17:38
64cf79e

Choose a tag to compare

Added

  • --allow-empty flag on check command — allows zero SHA arguments, useful with --exclusive to assert no hunks exist (e.g., check --exclusive --allow-empty --staged asserts nothing is staged)

v0.9.0

03 Mar 16:36
196b056

Choose a tag to compare

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 --staged for ref vs index comparison
    • Supported on all commands except stash
    • Contextual error messages when ref-based patches don't apply cleanly

Fixed

  • Redundant "PatchFailed" error line no longer printed after descriptive error message

v0.8.3

01 Mar 19:20
b9d89b9

Choose a tag to compare

Fixed

  • Cross-platform test compatibility: replace BSD-only sed -i '' with portable sed -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

01 Mar 19:11
c9c9259

Choose a tag to compare

Fixed

  • Cross-platform test compatibility: replace BSD-only sed -i '' with portable sed -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)