--diff with a commit or a range to check only what changed.
Three forms
The working tree never affects the result.
--diff reads the commits themselves, not your local edits.
Restrict a scan to the files one commit or one range touched, with —diff.
--diff with a commit or a range to check only what changed.
--diff reads the commits themselves, not your local edits.