
Structural diff tool for code.
Free

Difftastic is a command-line tool that performs structural diffs, comparing files based on their syntax rather than line-by-line. This approach provides more accurate and human-readable diffs, especially when dealing with code formatting changes or wrapper additions. It leverages tree-sitter for parsing various programming languages and file formats, allowing it to identify the actual changes within the code, ignoring formatting differences. Difftastic supports a wide range of languages and file formats, providing a clear visualization of changes, including line numbers from the original files. It is open-source, MIT-licensed, and integrates with Git for easy use in version control workflows. The tool is designed to enhance code review and understanding by focusing on the semantic changes rather than superficial formatting alterations.
Compares code based on its syntax, providing more accurate diffs.
Focuses on semantic changes, filtering out cosmetic differences.
Accurately identifies and displays changes within wrappers.
Shows actual line numbers from the original files for easier navigation.
Supports numerous programming languages, including Clojure, Dart, Haskell, and more.
Supports various file formats like HTML, JSON, and YAML.
Seamlessly integrates with Git for use in version control workflows.
Install Difftastic using the instructions provided on the website (e.g., via package managers or from source).,Configure Git to use Difftastic as your diff tool (see the manual for specific instructions).,Navigate to your Git repository in the terminal.,Make changes to your files and stage them.,Use git diff or git difftool to view the structural diffs generated by Difftastic.
Easily identify and understand the actual changes made in code, improving the review process.
Quickly grasp the semantic differences between code versions, even with formatting variations.
Clearly see the impact of refactoring efforts by focusing on structural modifications.
Compare code that uses different formatting styles without being distracted by cosmetic differences.
Developers who need to review code changes, understand code history, and manage code versions effectively.
Contributors who want to easily see the changes made in pull requests and understand the impact of their contributions.
Difftastic is open-source and MIT-licensed, meaning it is completely free to use, modify, and distribute.