AI Help
How do I check for unrelated formatting changes in an AI-generated patch?
Review both the ordinary diff and a whitespace-ignoring diff to distinguish behavior changes from formatting churn.
Steps to follow
- Compare the patch against the correct base commit and list changed files and line counts.
- Use Git's whitespace comparison options to inspect substantive edits, then review formatting-only areas separately.
- Ask the agent to restore unrelated changes and rerun checks relevant to the remaining patch.
Example in practice
Illustrative example. A ten-line validation fix surrounded by a whole-file reformat should be reduced so the intended behavior is easy to review.
Related AI help
- How do I give an AI coding agent only the logs needed to diagnose a build failure?
- What should I put in a repository guide so an AI agent runs the right build commands?