Say I get a patch created with git format-patch
. The file is basically a unified diff with some metadata. If I open the file in Vim, I can see which lines have been modified, but I cannot see which characters in the changed lines differ. Does anyone know a way (in Vim, or some other free software that runs on Ubuntu) to visualize per-character differences?
A counter example where per-character diff is visualized is when executing vimdiff a b
.
update Fri Nov 12 22:36:23 UTC 2010
diffpatch is helpful for the scenario where you're working with a single file.
update Thu Jun 16 17:56:10 UTC 2016
Check out diff-highlight in git 2.9. This script does exactly what I was originally seeking.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…