git: full-length side-by-side diffs
Got this one from the git-ml (which I read via gmane, but that’s a different post):
I’m not very good at reviewing patches. Especially not if it’s something like JavaScript. git at least colorizes its diffs, which makes it somewhat better. But as soon as you have a big file which is being patched in multiple, disconnected places (different “hunks” in git terminology), so that the context between these hunks is missing, it gets to messy imho.
Fortunately there is an easy solution: In git there is contrib/difftool, which makes it easy to display git diffs side-by-side with a viewer of your choice. Of course that meant vimdiff for me. To see all the lines of a file (and not just the changed + a little context) I call git-difftool like this:
git-difftool --tool=vimdiff -U99999
Now you can alias that command and use the normal rev-parse arguments. As you can see on the screenshot you can easily distinguish between removed lines, added lines and changed lines. For changed lines the part that was changed is highlighted.