Add external diff tool support via INSTA_DIFF_TOOL#844
Merged
max-sixty merged 2 commits intomitsuhiko:masterfrom Dec 14, 2025
Merged
Add external diff tool support via INSTA_DIFF_TOOL#844max-sixty merged 2 commits intomitsuhiko:masterfrom
max-sixty merged 2 commits intomitsuhiko:masterfrom
Conversation
Closed
c3dc1bc to
2d32496
Compare
dyc3
reviewed
Dec 13, 2025
dyc3
left a comment
There was a problem hiding this comment.
I tried it out, this works great for me! Left some other notes though.
Comment on lines
+71
to
+73
| Environment variables: | ||
| INSTA_DIFF_TOOL External diff tool for displaying diffs (e.g., \"delta --side-by-side\"). | ||
| Invoked as: <tool> [args...] <old_file> <new_file> |
There was a problem hiding this comment.
It would be nice if this was also available as a cli argument.
When the INSTA_DIFF_TOOL environment variable is set (or --diff-tool CLI arg is provided), insta will use the specified tool to display snapshot diffs instead of the built-in diff. The tool supports arguments and is invoked as: <tool> [args...] <old_file> <new_file> Example usage: export INSTA_DIFF_TOOL=delta export INSTA_DIFF_TOOL="delta --side-by-side" cargo insta review --diff-tool difftastic The external tool output is captured and printed through normal channels, so it respects cargo test's output capture (diffs are hidden during `cargo insta test` just like the built-in diff). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The diff tool option is only useful for `cargo insta review` since `accept` and `reject` don't display diffs - they just apply operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2d32496 to
135150d
Compare
max-sixty
added a commit
that referenced
this pull request
Dec 18, 2025
## Summary - Add external diff tool support via `INSTA_DIFF_TOOL` environment variable (#844) - Add `test.disable_nextest_doctest` config option to `insta.yaml` (#842) - Skip non-insta snapshot files in unreferenced detection (#846) - Collect warnings from tests for display after run (#840) - Update TOML serialization to be up-to-date and backwards-compatible (#834) - Support `clippy::needless_raw_strings` lint (#828) ## Test plan - [x] All tests pass - [x] All lints pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think a nice solution to #843; would let any diff tool be used, including passing settings to that tool; so that something like side-by-side can work
PR description from Claude follows
When the INSTA_DIFF_TOOL environment variable is set, insta will use the specified tool to display snapshot diffs instead of the built-in diff.
The tool is invoked as: <old_file> <new_file>
Example usage:
export INSTA_DIFF_TOOL=delta
export INSTA_DIFF_TOOL=difftastic
The external tool output is captured and printed through normal channels, so it respects cargo test's output capture (diffs are hidden during
cargo insta testjust like the built-in diff).🤖 Generated with Claude Code