-b/-B options to diff

Haakon Riiser haakon.riiser at fys.uio.no
Wed May 24 17:21:27 CDT 2006


I've just started playing with Mercurial, and I like what I've
seen so far, except that hg diff doesn't have GNU diff's -b
(--ignore-space-change) and -B (--ignore-blank-lines) options.

I find these to be far more useful than -w, since the combination
-bB makes diff ignore all whitespace that is irrelevant in most
code, unlike -w which does /not/ ignore blank lines, but /does/
ignore whitespace inserted in the middle of a word (e.g.,
'foobar' == 'foo bar' when -w is enabled, which is generally
not the same to a compiler).

I took a quick look at mdiff.py, and it looks like -b and -B could
be easily implemented.  Has someone already done this, or should I
write a patch myself?  Any chance of getting this into the main
branch?

-- 
 Haakon


More information about the Mercurial mailing list