Skip to main content

Git Diff Mode

Git diff mode helps you review code changes instead of manually selecting every modified file.

What it does

PastePrompt can compare a base ref and a head ref, show the changed file list, and include diff context in a generated bundle. A ref can be a branch, tag, commit hash, or other local Git revision accepted by the repository.

Git diff mode can support workflows such as:

  • Diff-only review.
  • Diff plus full changed files.
  • Diff plus selected dependencies.
  • Sponsor fix review.
  • Pull request review.
  • Audit follow-up review.

Why it matters

Most review tasks are about changes: a sponsor fix, a pull request, a patch after audit feedback, or a regression introduced by a branch. Diff mode focuses the bundle on what changed while still allowing you to add surrounding files for context.

It helps you:

  • Avoid missing changed files.
  • Preserve exact base/head refs in the bundle.
  • Review deleted and renamed files deliberately.
  • Pair the diff with full file contents when needed.
  • Build repeatable sponsor fix review artifacts.

How to use it

  1. Select a Git repository.
  2. Open Git diff mode.
  3. Enter or choose a base ref.
  4. Enter or choose a head ref.
  5. Review the changed file list.
  6. Decide whether the bundle should include:
    • Diff only.
    • Diff plus full changed files.
    • Diff plus selected related files.
  7. Review deleted, renamed, and large files.
  8. Add a review prompt template.
  9. Enable and run the secret scanner before copy or export when the diff may include sensitive values.

Base and head

The base ref is the version you are comparing from. The head ref is the version you are reviewing.

Examples:

main...HEAD
audit-base...sponsor-fix
v1.2.0...feature/security-fix

Use the same base/head pair in your notes so another reviewer can reproduce the diff.

Changed, deleted, and renamed files

Changed files should appear in the diff list. Deleted files may appear with no head-side contents. Renamed files can be shown as renames when Git detects the relationship, but large rewrites may appear as delete plus add.

Review deleted and renamed files carefully because they can remove validations, tests, or safety checks without adding obvious replacement code.

Huge diff warnings

Large diffs can exceed model budgets and make review quality worse. PastePrompt should warn when a diff is unusually large, when individual files dominate the bundle, or when generated files appear in the changed list.

Example workflow

  1. Use audit-base...sponsor-fix for a sponsor patch.
  2. Include the diff and full contents of changed source files.
  3. Add related interfaces and dependencies from the file tree.
  4. Apply the Sponsor Fix Review template.
  5. Ask the LLM to compare the patch against the original issue and identify remaining edge cases.
  6. Verify every model conclusion manually against the diff and full files.

Limitations

  • Diff mode depends on local Git data. Missing refs, shallow clones, submodules, or corrupted Git state can block comparison.
  • Huge diffs may need to be split into multiple bundles.
  • Rename detection is Git-dependent and may not match your mental model of the change.
  • Diff-only review can miss behavior that depends on unchanged code.
  • Including full changed files improves context but increases token usage.