mirror of
https://github.com/git/git.git
synced 2025-03-15 11:51:20 +00:00
pager: environment variable GIT_PAGER to override PAGER
Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
aa086eb813
commit
c27d205aae
@ -627,6 +627,9 @@ git Diffs
|
||||
|
||||
other
|
||||
~~~~~
|
||||
'GIT_PAGER'::
|
||||
This environment variable overrides `$PAGER`.
|
||||
|
||||
'GIT_TRACE'::
|
||||
If this variable is set git will print `trace:` messages on
|
||||
stderr telling about alias expansion, built-in command
|
||||
|
4
pager.c
4
pager.c
@ -15,10 +15,12 @@ void setup_pager(void)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd[2];
|
||||
const char *pager = getenv("PAGER");
|
||||
const char *pager = getenv("GIT_PAGER");
|
||||
|
||||
if (!isatty(1))
|
||||
return;
|
||||
if (!pager)
|
||||
pager = getenv("PAGER");
|
||||
if (!pager)
|
||||
pager = "less";
|
||||
else if (!*pager || !strcmp(pager, "cat"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user