@matheusbsbs / matheus-bagliano / commits / 34fd1c9ac5
Fork 0

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>

Linus Torvalds committed Apr 21, 2006 at 12:25 UTC 34fd1c9ac5845d541e3196983df7f993e751b544
1 file changed +2
pager.c
+2
@@ -8,6 +8,7 @@
8 static void run_pager(const char *pager)
9 {
10 execlp(pager, pager, NULL);
11 + execl("/bin/sh", "sh", "-c", pager, NULL);
12 }
13
14 void setup_pager(void)
@@ -47,5 +48,6 @@ void setup_pager(void)
48
49 setenv("LESS", "-S", 0);
50 run_pager(pager);
51 + die("unable to execute pager '%s'", pager);
52 exit(255);
53 }