[PATCH 4 of 8 STABLE] pager: rename 'pager.enable' to 'ui.pager'

Kevin Bullock kbullock+mercurial at ringworld.org
Mon May 1 16:23:22 EDT 2017


> On May 1, 2017, at 11:12, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1493649410 -7200
> #      Mon May 01 16:36:50 2017 +0200
> # Branch stable
> # Node ID 5f53e796056e717a208d389b845c0a6d22c405bf
> # Parent  ea4296acb04e7d3f7a1e163023c737ef6edf8bee
> # EXP-Topic pager
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 5f53e796056e
> pager: rename 'pager.enable' to 'ui.pager'
> 
> This aligns with what we do for color (see 7fec37746417). Pager is a central
> enough notion that having the master config in the [ui] section makes senses. It
> will helps with consistency, discoverability. It will also help having a simple
> and clear example hgrc mentioning pager.
> 
> The previous form of the option had never been released so the rename seems fine.

This turns out to be a bit of a can of worms that Augie, Pierre-Yves, Jun, Sean, I, and others have been discussing via VC and IRC today. To summarize:

* pager.enable is inconsistent with ui.color=yes/no/auto/always

  * ...but ui.pager is confusing in comparison to ui.editor and pager.pager

* We've already released pager.enable in 4.2-rc, and while that isn't subject to the normal BC guarantees, it would suck to change the name of the config setting again for our most active testers (i.e. those who bothered to install the RC)

* Setting ui.pager=yes would mean that even commands that don't invoke the pager would be paged. This seems like a pretty clear bug.

* Additionally, ui.color=yes currently means the same as --color=always, which (Augie and I think) goes a bit too far. Case in point: if a global config sets ui.color=False, a user wanting to turn it back on is likely to simplistically set ui.color=True. They would then get colorized output even if stdout is not a TTY, probably breaking their scripts.

  * This has a pretty obvious workaround (set ui.color=auto instead), so could be fixed in 4.2.1.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list