Difftastic Changelog

What's new in Difftastic 0.58.0

May 12, 2024
  • Parsing:
  • Difftastic now preserves tree-sitter parse tree structure on parse error nodes. This reverts the flattening behaviour introduced in 0.38. Preserving structure tends to produce better diffs, although it increases the risk that difftastic will show fewer changes in the presence of parse errors.
  • Since difftastic is now conservative with parse errors (DFT_PARSE_ERROR_LIMIT is 0 by default), this seems like a better tradeoff.
  • Updated C, C++, CMake, CSS, Elm, Go, Lua and Python parsers.
  • Diffing:
  • strip-cr now defaults to on, so comparing a file with CRLF endings with a file with unix line endings will not show spurious changes.
  • Documentation:
  • Difftastic now has a man page, see the difft.1 file.
  • Performance:
  • Fixed a memory leak and improved performance in some cases.
  • Command Line Interface:
  • Fixed a crash when difftastic could not detect the terminal width, such as inside eshell.
  • Difftastic now also considers $COLUMNS when detecting the terminal width.

New in Difftastic 0.57.0 (Apr 2, 2024)

  • Parsing:
  • Text file detection is now stricter, considering null bytes as a hint that files are binaries.
  • Diffing:
  • Fixed an issue where hidden files (filename starting with .) were ignored when diffing directories.
  • Scheme now uses the same slider heuristics as other lisps, preferring the outer delimiter.
  • Fixed an issue with line-based diffing where only the first line in a large changed region was highlighted. This was particularly noticeable when diffing brand new files.
  • Display:
  • Fixed an issue when reporting changes in binary files, where trailing whitespace was inconsistent with other changes shown.

New in Difftastic 0.56.1 (Mar 6, 2024)

  • Fixed an issue with building difftastic on aarch64 with rust 1.71 or earlier.

New in Difftastic 0.55.0 (Feb 6, 2024)

  • Parsing:
  • Added support for Objective-C and VHDL.
  • Files starting with <?xml are now parsed as XML.
  • Fixed a munmap_chunk(): invalid pointer crash on parsing some large files, particularly JSON.
  • Display:
  • The default display width for tabs has changed to 4.
  • Fixed an issue where difftastic would sometimes output literal tabs rather than respecting the display width for tabs.
  • Build:
  • difftastic now requires Rust 1.65 to build.

New in Difftastic 0.54.0 (Jan 7, 2024)

  • Parsing:
  • Added support for Salesforce Apex.
  • Improved parsing of regex literals in Clojure and strictness annotations in Haskell.
  • Diffing:
  • Difftastic will now also report file permission changes.
  • Fixed an issue where directory diffing would show a file more than once.
  • Display:
  • Fixed a rare crash when the last non-blank line had changes for certain parsers, particularly YAML.
  • Command Line Interface:
  • Difftastic now errors if given a single path, unless that file contains conflict markers. Previously this was a warning.
  • Build:
  • Difftastic now requires Rust 1.63 to build.

New in Difftastic 0.53.1 (Nov 27, 2023)

  • Fixed a dependency issue that broke aarch64 builds on older rustc versions.

New in Difftastic 0.53.0 (Nov 24, 2023)

  • Parsing:
  • Added support for SCSS.
  • Updated the Kotlin parser and improved handling of Kotlin nullable types.
  • .snap files (Jest snapshots) are now detected as JavaScript files.
  • Diffing:
  • Fixed an issue where adding or removing blank lines would be ignored by the textual diffing logic.
  • Directory diffing now respects .gitignore files.
  • Directory diffing can now be sorted by path with the --sort-paths option.
  • Command Line Interface:
  • Added the option --strip-cr. This removes all carriage return characters before diffing, which is helpful when dealing with a mix of Windows and non-Windows flies.
  • The option --skip-unchanged now has a corresponding environment option DFT_SKIP_UNCHANGED.

New in Difftastic 0.52.0 (Oct 9, 2023)

  • Parsing:
  • Added support for XML and JSONL.
  • Diffing:
  • Text nodes now get word diffing, consistent with string literals and comments. This is used in languages like HTML and XML that have separate text nodes.
  • Display:
  • Improved syntax highlighting of constructors (i.e. type names when values are constructed, such as Foo {}).
  • Improved syntax highlighting for C#.
  • Build:
  • This release does not provide a prebuilt musl binary, due to a dynamic linking issue with binaries in the release script.
  • Musl remains tested in CI and supported for users, but you will need to compile difftastic from source.

New in Difftastic 0.51.1 (Aug 26, 2023)

  • Parsing:
  • Updated Bash, Python and Rust parsers.
  • Display:
  • Added a JSON display option. This is currently unstable, and requires you to set DFT_UNSTABLE. The JSON structure may change in future.
  • Please give it a try and give feedback on GitHub issues.
  • Build:
  • Added support for Linux with musl, Linux on aarch64, and macOS on aarch64.
  • Note that Difftastic already worked on these platforms, but they are now tested in CI and will be included in prebuilt binaries in releases.

New in Difftastic 0.50.0 (Aug 16, 2023)

  • Conflicts:
  • Difftastic now supports parsing files with conflict markers, enabling you to diff the two conflicting file states.
  • $ difft file_with_conflicts.js
  • Parsing:
  • Updated Elixir, Erlang, Go, Kotlin and Racket parsers.
  • Display:
  • Tweaked the colours on the file header, to make metadata less prominent.
  • Improved styling of file rename information.
  • Improved syntax hightling for Java built-in types.
  • Diffing:
  • Fixed an issue with runaway memory usage when the two files input files had a large number of differences.
  • Build:
  • Difftastic now requires Rust 1.59 to build.

New in Difftastic 0.49.0 (Jul 27, 2023)

  • Parsing:
  • Added support for LaTeX.
  • Updated grammars for C, C++ and Java.
  • Improved parsing of qualified constructors in Haskell.
  • Difftastic is now stricter about valid UTF-8 and UTF-16, considering more of the file's bytes during filetype detection. This fixes cases where e.g. PDF was sometimes incorrectly considered as UTF-8.
  • Diffing:
  • Improved handling of delimiters ("nested sliders") in languages that prefer the outer delimiter, such as JSON and Lisps.

New in Difftastic 0.48.0 (Jul 13, 2023)

  • Difftastic is a structural diff tool that understands syntax. See the manual to get started, and the changelog for historical changes.
  • Parsing
  • Updated Scala parser.
  • Improved parsing of qualified modules and variables in Haskell.
  • Diffing
  • Replaced strings now have subword highlighting, consistent with replaced comments. Thanks @amnore!
  • Fixed an issue with the cost model for comment replacement, leading difftastic to prefer modified comments even when exact comment matches are possible.
  • Simplified the cost model, which previously had an inconsistent heuristic depending on whether there were multiple items on the same line. This can lead to slightly different items being marked as changed, but on average the results are better.
  • Display
  • Improved word highlighting in comments when they contain numbers or hyphens.
  • Internals
  • Difftastic's logging is now configured with the environment variable DFT_LOG. This was previously RUST_LOG, which could interfere with users configuring logging for their own development work.

New in Difftastic 0.47.0 (May 17, 2023)

  • Language Detection:
  • Fixed an issue where file extensions of the form *.foo.bar (e.g. *.cmake.in) were ignored.
  • Added an option --override which overrides language detection based, on a glob, e.g. --override='*.js:javascript jsx'. See --help` for full documentation and more examples.
  • Removed the --language option. This option was confusing (it took a file extension rather than a language name) and not very useful (it overrode language detection for all files together).
  • Parsing:
  • Added support for Solidity.
  • Display:
  • When difftastic is invoked with two file paths, it will now truncate the path shown to the shared common parts. This is particularly helpful when using difftastic with mercurial.

New in Difftastic 0.46.0 (Mar 31, 2023)

  • Added support for Ada.
  • .ino files are now treated as C++.
  • Improved parsing for TOML.
  • Updated grammars for Bash, C, C++, C#, Clojure, CMake, Elixir, Go, Java, JavaScript, OCaml, Perl, QML and TypeScript.
  • Difftastic now prefers treating files as 'mostly UTF-8' or binary rather than UTF-16. Many files can be decoded as UTF-16 without decoding errors but produce nonsense results, so this heuristic seems to work better.
  • Fixed an issue where difftastic would discard the last newline in a file before diffing. This was most noticeable when doing textual diffs and the last line had changed.

New in Difftastic 0.45.0 (Mar 4, 2023)

  • Diffing
  • Racket and Newick are now treated as lisps for the purposes for parenthesis heuristics.
  • Parsing
  • Fixed an issue where parse errors were undercounted, particularly in YAML files.
  • Improved parsing for Makefiles.

New in Difftastic 0.44.0 (Mar 3, 2023)

  • Parsing:
  • Added support for Newick and Racket.
  • Diffing:
  • Difftastic now uses a textual diff on files that have any parse errors. The parse error limit defaults to 0, but it is configurable with DFT_PARSE_ERROR_LIMIT or --parse-error-limit.
  • Textual diffing now respects --check-only, consistent with syntactic diffing.
  • Display:
  • Improved syntax highlighting for keywords.
  • If a file exceeds DFT_BYTE_LIMIT, difftastic now displays its size in the header.

New in Difftastic 0.43.1 (Feb 5, 2023)

  • This release has no logic changes from 0.43.
  • The only difference is that the test_gzip_is_binary test is ignored by default, as it depends on MIME database availability. This database isn't always installed in packaging environments, so packagers saw this test failing.

New in Difftastic 0.43.0 (Feb 3, 2023)

  • Parsing:
  • Added support for R.
  • Difftastic now considers gzipped files to be binary, even if they happen to be valid UTF-16 (thanks @Miksu82).
  • Diffing:
  • Fixed a rare crash when one file had repeated lists that partially matched the other side.
  • Display:
  • Fixed an issue with single-column display when colour is disabled, where newlines were missing from the output.
  • Command Line Interface:
  • --help now shows the default value for all arguments (it was previously missing --color and --display).
  • --color can now be configured with the environment variable DFT_COLOR.
  • Fixed an issue where git on Windows would fail with an error about /dev/null (thanks @n9v9).

New in Difftastic 0.42.0 (Jan 16, 2023)

  • Parsing:
  • Improved CSS parsing and HTML sublanguage parsing.
  • Diffing:
  • Added an --ignore-comments option.
  • Improved textual diffing performance, particularly when the two files have few lines in common.
  • Display:
  • Fixed an issue with unwanted underlines with textual diffing when DFT_BYTE_LIMIT is reached.
  • Fixed a crash in inline display when the file ends with whitespace.
  • Build:
  • Renamed the vendored parser directory to vendored_parsers/, as cargo vendor would clobber the vendor/ directory.

New in Difftastic 0.41.0 (Jan 9, 2023)

  • Parsing:
  • Difftastic now supports embedded languages in HTML and Makefiles. This enables difftastic to parse embedded CSS or JavaScript in HTML, or Bash in Makefiles, leading to better diffs in those files. (Contributed by @sesse, thanks!)
  • Tab replacement is now done after parsing. If tab characters are syntactically important, they are now handled correctly. This was particularly an issue in Makefiles, where indentation must be tabs.
  • Diffing:
  • Improved word highlighting in changed comments. Whitespace is never underlined and the characters - and _ are now considered word constituents.
  • Display:
  • --display=inline now respects --tab-width.
  • Fixed an issue with unwanted underlines with textual diffing when DFT_GRAPH_LIMIT is reached.
  • Improved syntax highlighintg for predefined types in TypeScript.

New in Difftastic 0.40.0 (Dec 28, 2022)

  • Diffing:
  • Diffing is now more efficient: the generated graphs have ~20% fewer vertices. This improves performance (less memory, shorter runtime), and also enables difftastic to handle larger files (you're less likely to reach DFT_GRAPH_LIMIT).
  • This improvement was contributed by @QuarticCat, thanks!
  • Parsing:
  • Rebar files (e.g. rebar.lock) are no longer associated with Erlang, only *.erl files, as the Erlang parser does not currently support them.
  • Command Line Interface
  • --list-languages now shows filenames associated with languages (e.g. Cargo.lock is TOML) in addition to extensions.
  • Display:
  • Symlinks are now expanded before calculating relative paths, resulting in relative paths being shown in more cases.
  • Build:
  • Difftastic is now built with Ubuntu 20.04 on Gi

New in Difftastic 0.39.0 (Dec 19, 2022)

  • Parsing:
  • Added support for Erlang.
  • Improved detection of binary content when the MIME type database incorrectly claims a text file is another format.
  • Display:
  • Paths are now always displayed relative to the current working directory.
  • Fixed a race condition where diffing directories would lead to interleaved output from different files.
  • Command Line Interface:
  • Added a --check-only flag that reports if there are any syntactic differences, but doesn't calculate or print them. This is much faster than normal syntactic diffing.
  • Difftastic now sets the exit code if it finds changes and --exit-code is set. See usage in the manual for the full list of exit codes used.

New in Difftastic 0.38.0 (Nov 14, 2022)

  • Parsing:
  • Syntax error nodes are now always treated as atoms. This produces better results when difftastic doesn't fully support the syntax (e.g. PostCSS is a superset of CSS) or when there are actual syntax errors.
  • Fixed a crash on file content detection when the local MIME database contains blank lines.
  • Display:
  • Line numbers styling has been tweaked to make it more visually distinct from file content.
  • Fixed an issue with inline display discarding newlines when color is disabled, leading to broken display.
  • Two column display now ensures that both columns have the same width, so line wrapping is at the same point on both sides.

New in Difftastic 0.37.0 (Oct 15, 2022)

  • Diffing:
  • Improved runtime performance and memory usage (thanks to @QuarticCat).
  • Standalone . is now considered punctuation in the diff cost model, which improves diff results in some cases.
  • Parsing:
  • Updated to the latest tree-sitter parser for Swift.
  • Command Line Interface
  • Difftastic will now read a file from stdin if given - as a path argument.
  • Added an option --context to control the number of lines of context displayed.
  • --list-languages now respects the value of --color, whose default only uses styling when stdout is a TTY.
  • Display
  • Fixed side-by-side display width when color is disabled (when piping difftastic stdout or with --color=never).
  • Build:
  • Fixed an issue with building on Windows with gcc.

New in Difftastic 0.36.1 (Sep 18, 2022)

  • 0.36.1 is functionally identical to 0.36.0, but fixes a bug in the release script that prevented Windows binaries from being built.

New in Difftastic 0.35.0 (Sep 3, 2022)

  • Diffing:
  • Difftastic now fixes sliders in more cases, producing better diff results.
  • Parsing:
  • Difftastic will now autodetect files in UTF-16-BE and UTF-16-LE. Previously it required files to be UTF-8.
  • Added support for Makefiles.
  • Fixed an issue with HCL language detection on .workflow files. Fixed an issue with Makefile language detection.

New in Difftastic 0.34.0 (Aug 28, 2022)

  • Build:
  • Fixed build on Rust 1.61+.
  • Display:
  • Fixed an issue where side-by-side display would sometimes print the line number from the second file rather than the first file.

New in Difftastic 0.33.0 (Aug 22, 2022)

  • Diffing:
  • Difftastic now explores 2x more parenthesis nesting possibilities. This can make diffing slower, but produces substantially better results.
  • Parsing:
  • Added support for CMake.
  • Improved comment detection using tree-sitter syntax highlighting queries.
  • Fixed an issue with language detection when file names were very short.
  • Command Line Interface:
  • Difftastic prefers to show the second path when called with two arguments. This fixes an issue (broken in 0.31) where the path would be shown as /tmp/git-blob-abc/file_name.
  • Build:
  • Difftastic now requires Rust 1.57 to build.
  • Fixed build on Windows. Previously it would fail non-deterministically.

New in Difftastic 0.32.0 (Aug 8, 2022)

  • Diffing:
  • Improved performance in many cases, particularly for files with a fairly flat structure.
  • Command Line Interface:
  • Difftastic now treats the path /dev/null as an empty file, even if that path doesn't exist on the current machine. This fixes a crash when using difftastic with git on Windows.