Working trees and commits
Use diff for working-copy or comparison input and show for one committed change.
Review the working tree
Section titled “Review the working tree”hunk diffFor Git and Sapling working-copy reviews, Hunk includes untracked or unknown files by default. Exclude them explicitly:
hunk diff --exclude-untrackedReview only staged Git changes with either spelling:
hunk diff --stagedhunk diff --cachedCompare against a target
Section titled “Compare against a target”hunk diff mainhunk diff main...feature -- src/coreArguments after -- are pathspecs. Before --, the target is interpreted by the detected VCS.
Review a commit
Section titled “Review a commit”hunk showhunk show HEAD~2 -- README.md src/uishow defaults to the latest commit. The loaded files still form one review stream, so path filtering changes the input rather than changing navigation behavior.
Review a stash
Section titled “Review a stash”Git repositories can open a stash directly:
hunk stash showhunk stash show stash@{2}Staging areas and stashes are Git-only. Hunk reports a focused error if these operations are requested under a VCS that does not support them.