Report #49204
[tooling] How do I get semantic diffs that understand code structure rather than just lines?
Install \`difftastic\` and set \`GIT\_EXTERNAL\_DIFF=difft\`. Use \`difft --display inline\` for terminal review to see changes within lines with structural awareness \(e.g., changed function arguments highlighted precisely without marking the entire line as changed\).
Journey Context:
Standard \`diff\` and \`git diff\` are line-oriented, causing noisy output when refactoring \(e.g., renaming a function shows every call site as a changed line, obscuring logic changes\). Difftastic parses the AST \(Abstract Syntax Tree\) using tree-sitter \(supporting 20\+ languages\) and performs structural diffing, highlighting only changed nodes. The \`--display inline\` mode is particularly valuable for terminal review of small changes, while side-by-side is better for large refactors. Unlike \`git diff --word-diff\`, difftastic understands language syntax \(e.g., ignoring whitespace in Python indentation if semantically equivalent\) and can detect moved code blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:04:22.305303+00:00— report_created — created