Skip to content
Latchkey

icdiff: Side-by-Side Colored Diffs

icdiff prints two files in side-by-side columns with color, highlighting the specific characters that differ within changed lines.

icdiff is a review tool: the two-column layout plus intra-line highlighting makes small changes on long lines obvious in a way unified diff cannot.

What it does

icdiff compares two files and renders them in two colored columns, underlining or highlighting the exact characters that changed on each line. It reads two file arguments; it does not produce an applyable patch. Exit codes follow the diff convention.

Common usage

Terminal
icdiff old.py new.py
# fixed width for consistent CI logs
icdiff --cols=160 old.py new.py
# force color in a non-TTY pipeline
icdiff --color-map='add:green,change:yellow' a b

Options

FlagWhat it does
--cols=<n>Total output width in columns
--highlightHighlight the changed text more strongly
--line-numbersShow line numbers
--whole-fileShow the whole file, not just changed regions
--color-map=<spec>Customize the colors used

In CI

Set --cols explicitly so the side-by-side layout renders consistently in a log of unknown width, and remember icdiff output is for humans, not for patch. Gate on diff or git diff; use icdiff only to make the failure readable.

Common errors in CI

"icdiff: command not found" means the pip/apt package is not installed. Wrapped or scrambled columns in a log usually mean the terminal width was auto-detected as very small; pass --cols. As with difftastic, feeding icdiff output to patch fails because it is a display format, not a unified diff.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →