D3212: patch: implement a new worddiff algorithm

dhduvall (Danek Duvall) phabricator at mercurial-scm.org
Thu Apr 12 10:10:23 EDT 2018


dhduvall added inline comments.

INLINE COMMENTS

> quark wrote in color.py:94
> There are not many choices - dim, 16/256 colors, or bold. We ended up with 16/256 colors internally for wider support (ex. tmux). But I'd like to express my (strong) options that:
> 
> - diff.inserted.changed and diff.inserted are same
> - diff.inserted is not bold
> 
> in this patch. Because color.py has no 16/256 support yet (and if it does detection conservatively, most terminals will only report 8 color support). And the only remaining choice is "dim". For weird terminals like tmux, I think it's their bugs to fix, not this patch.
> 
> That said, I'm fine with changing the defaults to whatever. So feel free to send follow-ups changing it.

I'm not sure what testing I did to claim "most", but I did make that comment in 2011, and xterm didn't start supporting dim until 2014 (it had long supported invisible), so that certainly helped inform that comment. Given @spectral's survey, I'd probably rewrite the comment simply to say that we're using `ui.debug()` to not be noisy in the wide world of different terminals.

Given support by xterm, iTerm2, and Terminal.app (and I just verified gnome-terminal supports it, too), I'd lean towards just using dim whenever it made sense now, though it'd be nice to know that at least one major Windows terminal app supported it, too. I don't know how widespread rxvt-unicode is in the Linux world, or other terminal emulators that might not support it.

I won't comment on the dim-the-unchanged vs bright-the-changed bits, or how this interacts with the ANSI color mode, other than to say that the default colors aren't an interface, and can be tweaked later without worries about backwards compatibility. Obviously you don't want to change them radically without good reason once people get used to them, but tweaking dim/bold/normal/background/whatever once people have had a chance to experiment more widely might be a reasonable thing to do.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3212

To: quark, #hg-reviewers, durin42, yuja
Cc: indygreg, dhduvall, yuja, spectral, mercurial-devel


More information about the Mercurial-devel mailing list