Always Use Git Diffs
posted by Steve Losh on October 22, 2009
The default style of diffs that Mercurial outputs for commands like
is a style that’s compatible with the UNIX
patch program. I suppose that’s
nice if you use
patch a lot, but most of us don’t.
Git introduced a new format that has some features that make certain diffs more readable, and Mercurial can take advantage of that.
[diff] git = True
That’s it! All of Mercurial’s commands that output diffs will now use this
better format. Now when you rename a file with
hg rename the diffs will say
“file X renamed to Y” instead of treating it as a separate remove and add.