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

Re: Should "git help" respect the 'pager' setting?

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 30, 2013, 16:56 UTC
Message-ID
<CALkWK0=RUy6=4k9uGpy2efdL8DhOnNO52rHZWSmHP3C=2a4SUw@mail.gmail.com>
In-Reply-To
<vpqtxlko1vn.fsf@anie.imag.fr>
Matthieu Moy wrote:
Show 11 quoted lines
> Michael Campbell <michael.campbell@gmail.com> writes:
>> I have my global git config pager set to 'cat', but when I do a "git
>> help <command>", it still uses a pager.  This is especially irksome in
>> emacs shell buffers, where I am most of the time.  I know I can do a
>> M-x man -> git-<whatever>, but wondered if this was a bug or user
>> error.  ("git --no-pager help <command>" does the same.)
>
> "git help foo" just calls "man git-foo" by default, so what happens is
> the same as if you called "man git-foo" by hand. Git does not have
> much control over what man will do, it could probably call "man -P
> $pager" when the Git pager is set, but I'd find it a bit weird.

It just needs to set $PAGER or $MANPAGER before the exec(), no? I would argue that it should do this. $GIT_PAGER works everywhere else, but obviously man has no knowledge about it.

> If you're an Emacs user, you can read about man.viewer and set it to
> woman, or set PAGER=cat when inside Emacs.

I just learnt about man.viewer. There's a small problem with it though: why is there no option for Emacs man corresponding to Emacs woman?

> I personally run M-x git-foo RET, and never run "git help".

M-x man git-foo RET, you mean? My style is slightly different: I love typing out 'man git log' on the terminal (dashless); I get it to open in an Emacs buffer using this hack:

function man_ () {
	emacsclient -e "(man \"$*\")" 2>&1 >/dev/null || man "$*"
}
alias man=man_
Previous: Matthieu MoyNext: Matthieu Moy
Message 3 of 7 in “Should "git help" respect the 'pager' setting?”
  1. Michael CampbellMay 30, 2013
  2. Matthieu MoyMay 30, 2013
  3. Ramkumar RamachandraMay 30, 2013
  4. Matthieu MoyMay 30, 2013
  5. Ramkumar RamachandraMay 30, 2013
  6. John KeepingMay 30, 2013
  7. Junio C HamanoJun 2, 2013

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.