[!TIP]
difftis an external diff enginedeltaanddiff-highlightare pagers (they only prettify the unified diff git already produced)
| TOOL | TYPE | IMPACT — examples |
|---|---|---|
difft |
external diff engine |
it replaces git's diff computation, so anything git normally does at the diff layer is skipped — textconv is just one example:
|
delta |
pager (restyles the diff git already produced) |
|
diff-highlight |
same pager model as delta, lighter:
|
common
- all make
git diff/git log -p/git showoutput nicer to read - all are read-only rendering — they never change the repo or the actual diff data git generates
- all should yield clean output on a non-tty (pipe / capture)
differences
| ASPECT | difft (difftastic) |
delta (git-delta) |
diff-highlight |
|---|---|---|---|
| category | external diff — replaces git's diff engine | pager — reads git's unified diff | pager (perl filter), same class as delta |
| diff algorithm | own structural / syntax-tree (AST) diff | git's line-level diff; only recolors/reformats | git's line-level diff; adds word-level emphasis |
| config entry | [diff] external / GIT_EXTERNAL_DIFF |
[core] pager / [pager] <cmd> |
[core] pager / [pager] <cmd> |
| bypassed by | git diff --no-ext-diff ✅ |
git --no-pager / git -c core.pager=cat auto-off on non-tty |
git --no-pager / auto-off on non-tty |
| can act as external? | yes (it is the external) | no — doesn't take GIT_EXTERNAL_DIFF's 7 positional args |
no — same as delta |
| line numbers / side-by-side / navigate | side-by-side, syntax coloring | line numbers, side-by-side, navigate, hyperlinks |
none, word-level emphasis only |
| parseable (for scripts/grep) | no (own format, not unified) | yes (with --no-pager it's git's native diff) |
yes (same as left) |
| install | brew install difftastic |
brew install git-delta |
ships with git contrib $(brew --prefix git)/share/git-core/contrib/diff-highlight/diff-highlight |
configuration
| CONFIG | delta (pager) |
diff-highlight (pager) |
difft (external diff) |
|---|---|---|---|
| TO BE DEFAULT |
|
|
|
| STYLING |
|
none — word-level emphasis only; tune the trailing less flags |
not via gitconfig — env vars:
|
| ON-DEMAND ALIAS |
|
|
|
| FORCE-USE one-off; ignores current pager & engine |
|
|
|
| WAY TO BYPASS |
|
|
|
--no-ext-diff / --no-pager behavior matrix
| COMMAND | INTERACTIVE TERMINAL (TTY) | PIPE / CAPTURE $(...) / | grep |
|---|---|---|
git diff |
delta-rendered | plain unified diff (pager auto-off) |
git diff --no-ext-diff |
still delta (pager applies on tty; --no-ext-diff only disables external) |
plain unified diff ✅ (neither external nor pager applies) |
git --no-pager diff |
plain unified diff (pager forced off) | plain unified diff |
git dft |
difftastic side-by-side | difftastic text (not unified, not for parsing) |
common pitfalls
| PITFALL | EXPLANATION |
|---|---|
--no-ext-diff won't disable delta |
delta is a pager, not an external. For plain output on a tty, use --no-pager. |
git log -1 "isn't using delta" |
no -p means no diff; delta passes it through. Verify with git log -p -1. |
pager.<cmd> outranks core.pager |
to temporarily disable the diff pager use -c pager.diff=false, not -c core.pager=cat. |
| delta double-colors pre-colored input | with color.diff=always, add --no-color before piping into delta. |
pre-commit always uses --no-ext-diff + captured output |
neither difft nor delta applies to it; switching diff tools does not affect pre-commit. |