Diff Tools

difftastic – structural diff tool that understands syntax

difftastic is a structural diff tool that compares files using their syntax rather than treating everything as a sequence of lines. It parses supported languages with tree-sitter and compares simplified syntax trees, allowing it to distinguish meaningful code changes from many formatting changes.

This approach is particularly useful when code has been reformatted, expressions have moved across lines, or indentation has changed without altering the underlying syntax. For files it cannot parse, difftastic falls back to a conventional line-oriented comparison with word highlighting.

This is free and open source software.

Key Features

  • Structural diffing based on syntax trees rather than raw lines.
  • Supports more than 30 programming languages together with structured formats including CSS, HCL, HTML, JSON, TOML and YAML.
  • Understands when whitespace is syntactically significant and when it is merely formatting.
  • Can show useful changes even when code has been reformatted across different lines.
  • Falls back to line-oriented diffing with word highlighting for unrecognised file types or parse failures.
  • Provides side-by-side output designed for terminal viewing.
  • Integrates with Git and Mercurial workflows.
  • Can interpret merge conflict markers and compare the two conflicting versions of a file.
  • Offers a check-only mode for determining whether two files have syntactic differences without calculating a full diff.
  • Allows a configurable number of parse errors before falling back to textual comparison.
  • Treats structural comparison as a graph problem and uses a shortest-path approach to calculate differences.
  • Can compare directories as well as individual files.

Website: github.com/Wilfred/difftastic
Support:
Developer: Wilfred Hughes
License: MIT License

difftastic in action
difftastic in action

difftastic is written in Rust. Learn Rust with our recommended free books and free tutorials.


Related Software

Terminal-Based Diff Tools
difftasticStructural diff tool that compares files based on their syntax
hunkTerminal diff viewer with syntax highlighting and side-by-side views
diff-so-fancyAttractive diffs with diff-highlight and more
deltaViewer for git and diff output
icdiffAn improved colored diff
diffoscopeIn-depth comparison of files, archives, and directories
colordiffWrapper for diff with pretty syntax highlighting
diffsitterSemantic diff tool
objdiffLocal diffing tool for decompilation project
ydiffTool to view colored, incremental diff in a version controlled workspace
diffrWord-by-word diff highlighting utility
dyffdiff tool for YAML files
WdiffWordwise implementation of diff
dwdiffdiff program that operates at the word level
diffymlCompares YAML documents by their structure
oyoStep-through diff viewer
diff2html-cliGenerate HTML diffs
biodiffTerminal-based binary diff viewer
dirdiffCompute the differences between two directories
csvdiffFast diff tool for comparing CSV files
VBinDiffVisual binary diff
riffWrapper around diff
csv-diffDiffing CSV and JSON files
xmldiffCompare XML documents
PatdiffFile diff using the Patience Diff algorithm
dead-ringerBinary diff utility
sesdiffGenerates a shortest edit script
semdiffSemantic diff tool written in Rust

Read our verdict in the software roundup.

Git Tools for Diff Review and Repository History
difftasticStructural diff tool that compares files based on their syntax
git-filter-repoQuickly rewrite git repository history
onefetchDisplays information about a local Git repository
git-statsLocal git statistics including GitHub-like contributions calendars
diff-so-fancyAttractive diffs with diff-highlight and more
BFG Repo-CleanerClean unwanted data from Git repository history
git-deltaViewer for git and diff output
gitlogueCinematic Git commit replay tool
git-quick-statsAccess various statistics in a git repository
git-whoCommand-line Git analysis tool
git-standupRecall what you did on the last working day
git-of-theseusAnalyze how a Git repo grows over time
git-sizerCompute various size metrics for a git repository
diffnavGit diff pager based on delta but with a file tree, à la GitHub
critiqueTerminal UI for reviewing git diffs
git-big-pictureVisualization tool for Git repositories
herculesGain advanced insights from Git repository history
keifuTUI that visualizes Git commit graphs
git-fameGit repository collaborators sorted by contributions
needleHighlights GitHub PRs
mergirafGit merge driver
git-historyAnalyze Git history using SQLite
ecTerminal Git mergetool
diffrWord-by-word diff highlighting utility
git-scopeFast TUI dashboard to view the git status of all your repositories
mamediffManages unstaged and staged Git diffs
deadbranchKeep Git repositories tidy
GitTopLightweight desktop client for GitHub notifications
git-heatmapGenerates a customizable heatmap

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted