文字単位で Diff が見られる「icdiff」

通常の diff だと行単位での差分しか見られないので、$ git diff --color-words --word-diff コマンドや --word-diff-regex='\\w+|[^[:space:]]' オプションを使って頑張って文字単位の差分を見たりしていた。

しかし、それ専用のコマンドがあった。icdiff というモノだ。「Improved Colored diff」で、ic-diff。

Python 製なので、pip でインストールできる。

$ pip install git+https://github.com/jeffkaufman/icdiff.git

あとは $ diff コマンドの代わりに $ icdiff コマンドを使えば良い。

git diff と違って、追加と削除の他に、「変更」が黄色で表示されるのが分かりやすくて良い。