colordiff produces diffs that are not always easy to read when a patch has
many whitespace changes or minor changes to each line. An upgraded diff tool,
such as diffr, can help.
Code getting refactored. But what has changed? colordiff isn't much better than diff here: we can tell which lines have been changed and which are new, but what has been changed in those refactored lines?
diffr to the rescue. Now we know very quickly that one line was added, and the rest is formatting.
brew install diffrIf you just want stock diffr, here's how to configure git to use it as the
diffing engine. (It might look different than in those screenshots, though.):
git config --global pager.diff diffr
git config --global pager.show diffr
git config --global pager.log diffr
git config --global interactive.diffFilter diffrHere's how I configured the style in the screenshots above. Your terminal
emulator must support "intense" and "italic" styles for these settings to work
-- but not all do. (Italic support seems to be particularly uncommon.)
kitty has all these modern bells
and whistles.
brew install kitty
diffr="diffr \
--colors removed:background:00:foreground:01 \
--colors refine-removed:background:0:foreground:124:italic \
--colors added:background:0:foreground:10 \
--colors refine-added:background:0:foreground:35:intense"
git config --global pager.diff "$diffr"
git config --global pager.show "$diffr"
git config --global pager.log "$diffr"
git config --global interactive.diffFilter "$diffr"diffr isn't the only option. Other popular extensions to colordiff include:

