Repository navigation
Pick single hunks in the terminal review - #10
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mudroom reviewin 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.j/kmove, space toggles,a/nselect all or none,xapplies.[~]with a count in the file list. Hunks applied earlier show as[=] ... (applied).apply(paths:hunks:)call, so onemudroom undoreverts all of it.Applier.hunks(for:), so it covers the same files as the app and uses the same numbers asmudroom 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 drovemudroom review lastin a pty against a real session: applying hunks 2 and 3 ofa.txtplusother.txtwrote exactly those, andmudroom undo lastrestored both files.