From: "Jörn Engel" <joern@logfs.org>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Revert "Stop starting pager recursively"
Date: Fri, 25 Apr 2014 16:10:49 -0400 [thread overview]
Message-ID: <20140425201048.GB29904@logfs.org> (raw)
In-Reply-To: <vpqoazpdz1r.fsf@anie.imag.fr>
On Fri, 25 April 2014 20:49:52 +0200, Matthieu Moy wrote:
> Jörn Engel <joern@logfs.org> writes:
> > On Mon, 21 April 2014 16:46:22 -0400, Jörn Engel wrote:
> >>
> >> This reverts commit 88e8f908f2b0c56f9ccf8134d8ff9f689af9cc84.
> >>
> >> Caused a usability regression for me and foul language for my coworkers.
> >
> > Ping.
>
> How do you solve the problem that the commit you revert was solving? The
> commit you propose to revert says in its message:
>
> git-column can be used as a pager for other git commands, something
> like this:
>
> GIT_PAGER="git -p column --mode='dense color'" git -p branch
>
> The problem with this is that "git -p column" also has $GIT_PAGER set so
> the pager runs itself again as another pager. The end result is an
> infinite loop of forking.
>
> There's probably a solution, but you can't ignore the problem (or
> someone else will later try to solve the infinite loop and revert your
> commit, and so on ...).
Disclaimer: I never looked at git internals before this regression
forced me to and am likely talking out of my arse.
One approach is "don't do that then". Someone explicitly changed the
git pager to be git, which itself takes the git pager, etc. That is
asking for infinite recursion and the original problem was that git
gave the user exactly what they asked for.
A second option is to add a --pager (or rather --no-pager) option to
the command line and allow the user to specify
GIT_PAGER="git --no-pager -p column --mode='dense color'" git -p branch
A third option is to try to be smart and give the user what he wants,
not what he asked for. If the pager happens to be git, unset
$GIT_PAGER, $PAGER and somehow disable core.pager. Yeah, that will
turn nasty rather quickly.
A fourth option is to set an environment variable for the pager
process itself. Disable paging similar to the original patch, but
make it conditional on we_are_the_pager(), not pager_in_use().
My preference is option four, but see disclaimer above.
Jörn
--
I've never met a human being who would want to read 17,000 pages of
documentation, and if there was, I'd kill him to get him out of the
gene pool.
-- Joseph Costello
next prev parent reply other threads:[~2014-04-25 20:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-21 20:46 [PATCH] Revert "Stop starting pager recursively" Jörn Engel
2014-04-25 18:29 ` Jörn Engel
2014-04-25 18:49 ` Matthieu Moy
2014-04-25 20:10 ` Jörn Engel [this message]
2014-04-26 7:13 ` Jeff King
2014-04-26 17:27 ` Junio C Hamano
2014-04-26 17:35 ` Jeff King
2014-04-27 2:12 ` Duy Nguyen
2014-04-27 7:56 ` Jeff King
2014-04-27 15:06 ` Matthieu Moy
[not found] ` <xmqqk3a9s7fm.fsf@gitster.dls.corp.google.com>
2014-04-28 18:32 ` Jörn Engel
2014-04-28 23:04 ` Junio C Hamano
2014-04-28 23:39 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140425201048.GB29904@logfs.org \
--to=joern@logfs.org \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).