I don’t know about you, but I like diff -p [1]. Having used it for years, I can read these diffs like a text, while diffs without -p often need to have the original file opened side by side, just to get enough of the context.
Loving diff -p so much, I want to see it everywhere (evil laughter). Alas, in bzr only diff command can easily use -p, just run it as bzr diff --diff-options=-p or store it as an alias in the ~/.bazaar/bazaar.conf.
Actually, for an alias there is a better, although more verbose, alternative:
[ALIASES]
diff = "diff --diff-options='-F ^[[:alpha:]$_].*[^:]$'"
Unlike simple -p it will not think that a word ending with a semicolon (like a label or, say, public: and private:) is a “C function name”.
But the problem is — only bzr diff can be tuned this way. Bzr email plugin still sends diffs without function names. And bzr gdiff does not show them. And, of course, all other bzr commands — bzr commit, for example, or bzr shelve, bzr unshelve --preview, bzr log --show-diff and others — they are still as unfriendly as before.
I was solving it on a case by case basis — added a post_commit_diffoptions configuration option to the bzr-email plugin, then a command line option to bzr gdiff. But then it occurred to me that I can attack the problem at its core!
Continue reading →