git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jeffrey Middleton <jefromi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: pager config for external commands
Date: Fri, 19 Nov 2010 11:00:58 -0500	[thread overview]
Message-ID: <20101119160058.GA7967@sigill.intra.peff.net> (raw)
In-Reply-To: <AANLkTimMSp8XVzoaax2mW-jYP26B+zF2QSJFcy4TUi60@mail.gmail.com>

On Fri, Nov 19, 2010 at 09:26:59AM -0600, Jeffrey Middleton wrote:

> External commands don't appear to support the pager.<cmd> config
> setting. It's implemented for builtins via the call to
> check_pager_config and associated code in run_builtin, but there's
> nothing like that in execv_dashed_external. Is there a reason not to
> implement this for external commands? I can't see one, since the
> --no-pager option does apply to them.

See 4e10738 (Allow per-command pager config, 2008-07-03) for some
discussion.

Basically the problem is that we just call execv("git-<cmd>"). If it
works, then we are running an external, but we no longer have an
opportunity to start the pager. If it doesn't, then we don't necessarily
want to commit our pager choice. We may be running an alias, or we may
simply barf with "no such command".

Later on, we started to use run_command instead of execv, but I don't
think that changes the situation.

I think what we really want to do is split out the "look up in PATH" bit
from run_command, actually find out if we have an external command, and
then commit to running it if it exists. If you're interested in working
on that, I think it would be great.

-Peff

  reply	other threads:[~2010-11-19 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTimtjR0O3K8iGOVVVaFJS2+2wHcHhWf45tFYXjRQ@mail.gmail.com>
2010-11-19 15:26 ` pager config for external commands Jeffrey Middleton
2010-11-19 16:00   ` Jeff King [this message]
2010-11-19 17:16     ` Jeffrey Middleton
2010-11-19 17:29       ` Jeff King

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=20101119160058.GA7967@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jefromi@gmail.com \
    /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).