Hunk vs diff-so-fancy
diff-so-fancy is a Perl script that tidies Git's diff output before your pager shows it: simpler file headers, + and - out of the gutter, colored empty lines, rulers between files. It adds no syntax highlighting and has no side-by-side view. Hunk is a review UI rather than a filter: a multi-file stream with a file sidebar, split and stack layouts, syntax highlighting, mouse support, watch mode, and inline agent annotations.
Which to choose
Choose Hunk if
- You want syntax highlighting, which diff-so-fancy does not do.
- You want a side-by-side view, which diff-so-fancy does not do.
- You review multi-file changesets and want a sidebar and hunk navigation.
- You want the diff to reload as you edit, or agent notes attached to hunks.
Choose diff-so-fancy if
- You want minimal, familiar output and nothing more.
- You want a Perl script and its
lib/in$PATH, with no binary to install. - Your habits are built around
lessand you do not want a UI.
What diff-so-fancy is
diff-so-fancy is a Perl script you drop in $PATH, alongside its lib/ directory, and put in front of your pager. It takes Git's diff output and makes it more human. File headers collapse to a readable line, the leading + and - come out of the gutter so copied code stays copyable, empty lines get colored so added and removed blanks are visible, and a ruler separates files.
It is deliberately small. No syntax highlighting, no side-by-side, no state. It is a text filter, and it has been one since 2015. It also covers git add -p through interactive.diffFilter, which Hunk does not replicate.
git config --global core.pager "diff-so-fancy | less --tabs=4 -RF"
git config --global interactive.diffFilter "diff-so-fancy --patch"What you get by moving to Hunk
The two usual reasons people leave are the two things diff-so-fancy does not do: syntax highlighting and side-by-side. Hunk has both, with a responsive auto layout that picks split on wide terminals and stack on narrow ones, plus theme selection you change from inside the review.
Past that it is a different category of tool. Every visible file forms one review stream with a sidebar indexing it, [ and ] walk hunks across the whole changeset, z expands unchanged context without re-running the diff, and the mouse works for scrolling, menus, and jumping to a file. hunk diff --watch keeps the review current while you edit, and agent notes render inline beside the hunks they explain.
The trade is real. Hunk is a bigger program than a Perl script, and it takes over the screen instead of printing into your scrollback. If tidy output in less is what you want, diff-so-fancy is still fine.
curl -fsSL https://hunk.dev/install.sh | sh
hunk diff # working tree, including untracked files
hunk show HEAD # the last commitHunk vs diff-so-fancy, capability by capability
diff-so-fancy is written in Perl and licensed MIT. Hunk is TypeScript, MIT, and ships as a standalone binary for macOS, Linux, and Windows.
| Capability | Hunk | diff-so-fancy |
|---|---|---|
| Syntax highlightingdiff-so-fancy restyles diff structure. It does not color code by language. | Yes | No |
| Side-by-side / split view | Yes | No |
Word-level highlighting inside a changed linediff-so-fancy computes character-level emphasis with a bundled copy of Git's contrib/diff-highlight, colored through color.diff-highlight.*, rather than a token-level word diff. | Yes | Partly |
| ThemesHunk ships 65 bundled themes and takes custom ones. diff-so-fancy takes its colors from your Git color settings. | Yes | Partly |
| Cleaned-up file headers and gutter | Yes | Yes |
| File sidebar you can jump from | Yes | No |
| Hunk-by-hunk navigation across the changeset | Yes | No |
| Mouse: click, wheel, scrollbar, menus | Yes | No |
| Change layout, wrapping, and theme mid-review | Yes | No |
| Expand unchanged context in place | Yes | No |
| Watch mode that reloads the review | Yes | No |
| Inline agent and human annotations on a hunk | Yes | No |
Works as a Git pager (core.pager) | Yes | Yes |
Works in git add -pdiff-so-fancy sets interactive.diffFilter. Hunk is a review viewer and does not filter interactive staging. | No | Yes |
| Runs with no language runtime installeddiff-so-fancy needs Perl 5.14+. Hunk's script, Homebrew, mise, and Nix installs are standalone binaries; only the npm install needs Node.js 22+. | Partly | No |
| Native Jujutsu and Sapling supportdiff-so-fancy works wherever a VCS lets you set a pager, and its docs show a Mercurial recipe. Hunk detects jj and Sapling workspaces and takes native revsets. | Yes | Partly |
| TypeScript extension API | Yes | No |
● yes · ◐ partly, see the note · ○ no
Questions people ask
Does diff-so-fancy have syntax highlighting?
No. It restyles the structure of Git's diff output, meaning headers, markers, empty lines, and rulers, but it does not color code by language. That is a common reason people move to a tool that does.
Does diff-so-fancy have a side-by-side view?
No. Its output is a single column. Hunk's split layout is side-by-side and is the default on wide terminals.
Is diff-so-fancy still maintained?
Yes. Commits continue through 2026, though tagged releases are infrequent: the last was v1.4.12 in August 2024. It is a mature script doing a fixed job, which is part of why it is still in so many dotfiles.
Can I keep diff-so-fancy and add Hunk?
Yes. Leave core.pager pointed at diff-so-fancy and run hunk diff when you want to review. If you would rather have Git open Hunk for diff output, set core.pager to hunk pager instead. Non-patch output still falls through to your plain-text pager.
Sources
Claims about diff-so-fancy were checked against its own documentation in September 2026. If something here has gone stale, open an issue and it gets fixed.