git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: pager config for external commands

From
Jeff King <peff@peff.net>
Date
Nov 19, 2010, 16:00 UTC
Message-ID
<20101119160058.GA7967@sigill.intra.peff.net>
In-Reply-To
<AANLkTimMSp8XVzoaax2mW-jYP26B+zF2QSJFcy4TUi60@mail.gmail.com>
On Fri, Nov 19, 2010 at 09:26:59AM -0600, Jeffrey Middleton wrote:
Show 6 quoted lines
> 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
Previous: Jeffrey MiddletonNext: Jeffrey Middleton
Message 2 of 4 in “pager config for external commands”
  1. Jeffrey MiddletonNov 19, 2010
  2. Jeff KingNov 19, 2010
  3. Jeffrey MiddletonNov 19, 2010
  4. Jeff KingNov 19, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.