Pager in core should be enabled by default

Matt Mackall mpm at selenic.com
Wed Dec 9 23:20:10 UTC 2015


On Mon, 2015-11-30 at 16:48 -0500, timeless wrote:
> So, I've started playing w/ pager (again -- I think I do for about a
> week every a year or so).
> 
> Here is my primary Workflow:
> 
> I am on OS X or Windows and have a large scrollback in my terminal
> (Terminal.app, PowerShell -- or even cmd), I like using `color`, and
> they like to use my mouse to scroll (to review) and then copy text
> (often to a pastebin or irc directed pastebin, but possibly into an
> email, or something else). I might even like using my terminal's Find
> dialog.
> 
> So, what did I do?
> 
> I hit "hg export", and that gave me a pager -- which isn't helpful.
> Someone suggested "HGPLAIN=1 hg export", but that eats my color --
> which isn't helpful.
> I tried "hg export .|cat", but I knew that would eat my color -- it
> wasn't helpful.
> 
> As an OS X user, I don't know about "pbcopy" and "pbpaste" (I'm not
> sure what portion of Mac users are familiar w/ them. I don't even
> know
> of Windows analogs).
> http://stackoverflow.com/questions/749544/pipe-to-from-clipboard has
> the answers for people who don't know them (clip is apparently the
> modern Windows answer).
> 
> But note: it's really bad form to send arbitrary content to your
> clipboard w/o reviewing it. Really dangerous. As someone involved in
> web browser development, it's one of those things we actively
> discourage because of how dangerous it can be.
> 
> ... While there may be ways to turn off the pager for a command (in
> fact, there are quite a few), the help for the pager command is tldr
> and also not particularly readable -- I've sent a patch to help it a
> little bit.
> 
> The way that the pager help is written today is incredibly confusing.
> 
> It says:
> > You can disable the pager for certain commands by adding them to
> > the pager.ignore list:
> 
> >  [pager]
> >  ignore = version, help, update
> 
> 
> Which kind of hints that I could do:
> [pager]
> ignore=export
> 
> But.
> 
> > You can also enable the pager only for certain commands using
> > pager.attend.
> > Below is the default list of commands to be paged:
> 
> >  [pager]
> >  attend = annotate, cat, diff, export, glog, log, qdiff
> 
> > If pager.attend is present, pager.ignore will be ignored.
> 
> It's hard for a normal human to figure out if this mean that
> `pager.attend` is present (because that's the default), and thus
> `pager.ignore` will be ignored, or if it doesn't count that.

I would state this as a general principle:

 "It's impossible to implement a combination whitelist/blacklist that
will make users happy."

There are lots of permutations of the obvious implementation, and thus
there are lots of different obvious assumptions about behavior. And
since a significant fraction of users will always complain if it
doesn't match their assumptions, even if it's correctly and thoroughly
documented, you'll always get complaints. And no point changing it,
you'll just get a different set of users complaining about the new
rules, plus a new set complaining you broke their config.

We've got several different whitelist/blacklist implementations in hg:

- -I/-X flags
- acls
- pager attend
- etc.

..and they're ALL different.

At any rate, the solution to this specific problem is:

[pager]
attend-export = false

..which respects the normal ordering of hgrc loading and doesn't affect
paging for other commands, so is probably the closest thing to an
intuitive interface. I'd probably be fine with de-emphasizing the list-
based attend and ignore settings.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list