#12058: Mercurial should not enable pager by default
------------------------+---------------------------------------------------
Reporter: jdemeyer | Owner: tbd
Type: defect | Status: needs_info
Priority: blocker | Milestone: sage-4.8
Component: packages | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------+---------------------------------------------------
Comment(by kini):
Replying to [comment:3 jdemeyer]:
> >Even if we did set a pager, it is set to only apply to the commands
annotate, cat, diff, log, glog, and qdiff. I question why one would need
to use these in a script in the first place, as they are by nature
interactive commands.
> There are 6 occurences of `hg diff` in the `$SAGE_ROOT/local/bin/*`
scripts, so I disagree.
Yes, and all six of them are mysterious and seem unnecessary to me.
> > This was introduced by #11121, not #10594
> Wrong, this was introduced in #10594. It is the Mercurial spkg which
writes `$SAGE_LOCAL/etc/mercurial/hgrc`. On #11121 I have made a comment
that I did not want the pager extension to be enabled by default.
The spkg on #10594 fixes #10594, #11121, and #11120 in three separate
commits to the mercurial repository in the spkg. There is zero discussion
of pagers on the trac ticket for #10594, whereas there is substantial
discussion of it on #11121. So I think it's fair to say that this was
introduced by #11121, and not by #10594. But this is immaterial I suppose.
> > As Volker pointed out on sage-devel, an even better way to avoid this
is to set the HGPLAIN environment variable.
> True, but I think that is an orthogonal issue. Even if we do use
`HGPLAIN` in scripts, I think we still should not enable the pager
extension by default.
Do you propose to also revert #11142, which explicitly uses the pager
extension?
> True, but `$SAGE_LOCAL/etc/mercurial/hgrc` is not under ''my'' control.
I personally do not want a pager to be enabled, so I do ''not'' enable the
pager extension in ''my'' `.hgrc`. It's true that I have the environment
variable `PAGER` set, but that is used for many things (like e.g.
`EDITOR`), so I don't want to disable it just for Sage.
Just to be clear, I think it was a bad idea, from an overall software
design perspective, to entangle Mercurial with Sage, create wrappers for
it in the Sage library, etc. in the first place. Maybe it was even a
mistake to bundle Mercurial at all. But one of the main goals behind the
way Sage is set up is to lower the barrier of entry and make things easier
for beginner developers, and I think part of that goal involves making
`sage -hg` as user-friendly as possible. The functionality implemented by
jhpalmieri at #11142 is part of this and requires the pager extension. So
too is making `sage -hg` understand your `$PAGER` variable and show things
with ANSI colors.
In short, it seems to me that `sage -hg` is meant to be an easy tool for
those who don't care about fine tuning their Mercurial. To my mind, Sage
is a ''mathematical'' software distribution, and the real reason that
Mercurial is distributed with it is not that it gives the user a Mercurial
installation, but rather that it 1) allows Sage to use Mercurial to do
various things with its scripts; and 2) allows you to use Mercurial from
the command line or from the Sage prompt to do some minimal amount of
actions that are necessary to contribute to Sage development. For more
advanced things, or if you desire more control, you are free to use your
own system Mercurial in whatever way you like - I certainly don't use
`sage -hg` myself in interactive shells. And if we are using `$HGPLAIN` in
scripts, the only objection remaining, as far as I can see, is the lack of
control over the behavior of `sage -hg` on the command line, which I don't
think is a legitimate issue, assuming the above is true.
Also, I don't think this even really needs mentioning, but if there is
really someone out there who cares so much, they can manually turn off the
pager extension in their `~/.hgrc` by setting `pager = !`. But I gather
you are not one of these people, as you say on sage-devel that you don't
use `sage -hg` anyway.
----
Now, maybe you are of the opinion that all what I said above is totally
wrong, and that Sage is supposed to be shipping Mercurial as a standalone
application, just like it ships GAP, Python, etc., and that you should be
able to use `sage -hg` just like you would use `hg`. Honestly, I could
agree with that. That would make more sense with Burcin's prefix system,
for example, which I hope one day Sage will eventually ship with.
But in that case most of #11121 doesn't make any sense anyway and most of
`$SAGE_LOCAL/etc/mercurial/hgrc` should be deleted (except the first two
lines). What do you think? I am fine with that, if that's what people
generally agree upon. In that case I would request that you start
rejecting patches that are not in git format, though, as that was the
original (and important) purpose of #11121. Luckily the patches on #11121
(i.e. not the commit in the spkg) mostly solve that problem.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12058#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.