git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Avishay Matayev <me@avishay.dev>,
	Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: Forcing git to use a pager without a tty
Date: Fri, 25 Jun 2021 12:42:39 -0500	[thread overview]
Message-ID: <60d6158fcef74_cc8d20834@natae.notmuch> (raw)
In-Reply-To: <CAJ-0Oswry0Rry_0ZqZzzVGuzfU-apZnv95LcxQEhm7GVA=uOxA@mail.gmail.com>

Avishay Matayev wrote:
> On Wed, 23 Jun 2021 at 04:57, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:

> > Seems like a completely sensible request to me, except I would do it a
> > slightly different place:
> >
> > --- a/pager.c
> > +++ b/pager.c
> > @@ -101,7 +101,7 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
> >
> >  void setup_pager(void)
> >  {
> > -       const char *pager = git_pager(isatty(1));
> > +       const char *pager = git_pager(git_env_bool("GIT_PAGER_FORCE", isatty(1)));
> >
> >         if (!pager)
> >                 return;
> >
> > I'm Cc'ing Jonathan Nieder who seems to have toched these lines.

> 
> Well I'm glad to hear you find it sensible, though your patch suggests
> that `GIT_PAGER_FORCE` will be a boolean, while I expect it to be an
> actual pager, which would make more sense IMO.

I just copied the idea from the GitHub issue, I find it simple and easy
to implement in the code this way. A GIT_PAGER_FORCE as you suggest
would be a bit more complicated.

Either way feel free to provide a patch with whatever approach you think
is best.

However, for a proper patch you need to add documentation too (see
Documentation/git-var.txt), and preferably some tests.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2021-06-25 17:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 22:40 Avishay Matayev
2021-06-23  1:56 ` Felipe Contreras
2021-06-23  8:25   ` Forcing git to use a pager without a tty Avishay Matayev
2021-06-25 17:42     ` Felipe Contreras [this message]
2021-06-26 10:28       ` Avishay Matayev
2021-06-23  8:12 ` Why empty subject? (was Re: ) Bagas Sanjaya
2021-06-23  8:21   ` Avishay Matayev
2021-06-23  9:05 ` Forcing git to use a pager without a tty Phillip Wood
2021-06-23  9:29   ` Phillip Wood
2021-06-24 20:25     ` Avishay Matayev
2021-06-24 22:10       ` Ævar Arnfjörð Bjarmason
2021-06-26 10:26         ` Avishay Matayev
2021-06-29  6:09         ` Junio C Hamano

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=60d6158fcef74_cc8d20834@natae.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=me@avishay.dev \
    /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).