Linus Torvalds  committed 34fd1c9

git-log produces no output

When $PAGER is set to 'less -i', we used to fail because we
assumed the $PAGER is a command and simply exec'ed it.

Try exec first, and then run it through shell if it fails. This
allows even funkier PAGERs like these ;-):

PAGER='sed -e "s/^/`date`: /" | more'
PAGER='contrib/colordiff.perl | less -RS'

Signed-off-by: Linus Torvalds <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 0dec30b

Comments (0)

Files changed (1)

 static void run_pager(const char *pager)
 	execlp(pager, pager, NULL);
+	execl("/bin/sh", "sh", "-c", pager, NULL);
 void setup_pager(void)
 	setenv("LESS", "-S", 0);
+	die("unable to execute pager '%s'", pager);