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

  1. Compare the patch against the correct base commit and list changed files and line counts.
  2. Use Git's whitespace comparison options to inspect substantive edits, then review formatting-only areas separately.
  3. 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

Official guidance

OpenAI documentation