Skip to content

Pick single hunks in the terminal review - #10

Merged
Kernel-Hunter merged 3 commits into
mainfrom
review-hunks
Oct 22, 2026
Merged

Kernel-Hunter merged 3 commits into
mainfrom
review-hunks

Conversation

@Kernel-Hunter

Copy link
Copy Markdown
Owner

mudroom review in the terminal can now apply single hunks, so the CLI on Linux, Windows and Intel Macs gets the same per-hunk review as the Mac app.

  • Enter on a modified text file opens it as hunks. j/k move, space toggles, a/n select all or none, x applies.
  • A file with only some hunks selected shows as [~] with a count in the file list. Hunks applied earlier show as [=] ... (applied).
  • Whole files and partial files go in one apply(paths:hunks:) call, so one mudroom undo reverts all of it.
  • Hunk mode uses Applier.hunks(for:), so it covers the same files as the app and uses the same numbers as mudroom hunks. Added, deleted, binary, symlink and mode-only files still apply whole.

Tests: 4 new cases in TerminalReviewTests, including an end-to-end apply of 1 of 3 hunks plus a second file, then a single undo. I also drove mudroom review last in a pty against a real session: applying hunks 2 and 3 of a.txt plus other.txt wrote exactly those, and mudroom undo last restored both files.

A modified text file opens as numbered hunks with a checkbox each. A file with some of its open hunks selected shows [~] and goes to the Applier as a hunk selection; all of them selected is a whole-file apply, as in the app.
… one call

Hunks come from the Applier through ReviewSnapshot.content, so the review uses the same rules and numbers as the app and apply --hunks. One apply call means one rollback bundle and one mudroom undo.
@Kernel-Hunter
Kernel-Hunter merged commit e19fc9a into main Oct 22, 2026
10 checks passed
@Kernel-Hunter
Kernel-Hunter deleted the review-hunks branch October 22, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant