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 <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Linus Torvalds 2006-04-21 12:25:13 -07:00 committed by Junio C Hamano
parent 0dec30b978
commit 34fd1c9ac5

View File

@ -8,6 +8,7 @@
static void run_pager(const char *pager)
{
execlp(pager, pager, NULL);
execl("/bin/sh", "sh", "-c", pager, NULL);
}
void setup_pager(void)
@ -47,5 +48,6 @@ void setup_pager(void)
setenv("LESS", "-S", 0);
run_pager(pager);
die("unable to execute pager '%s'", pager);
exit(255);
}