Git Integration
Differens plugs into your normalgit diff workflow. Instead of line hunks, it reports the semantic changes: renames, moves, added parameters.
Install the driver
One command registers Differens as a git diff driver in your repo’s local config and writes the.gitattributes rules itself:
driverExtensions. Existing .gitattributes lines are preserved: a line already matching an extension keeps its other attributes and gains the driver, every other line passes through, and running the command twice changes nothing. To cover fewer extensions, list them in differens.toml. Files without the attribute keep normal git diff output.
Now git diff on a .ts file shows the change instead of a hunk:
git diff, git diff --staged, and git difftool. To remove the driver later, unset the config. See the note in the git package reference.
Standalone modes
No git driver required.differens reads git directly.
Working tree
With no arguments,differens diffs the working tree against HEAD and correlates the changes across files:
git diff HEAD in semantic form. It picks up unstaged and staged changes, plus untracked files: a brand-new file is the most important change to report, so it is merged in from git ls-files --others.
Commit ranges
Two commits
Both arguments resolve as git refs, so two SHAs or branch names diff like a range:Two directories
If both arguments are directories, Differens walks each one and diffs matching relative paths:node_modules, dist, .git, …) are skipped. There is no size cap: every file is read and diffed for real.