summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2006-04-21 19:25:13 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-21 20:00:10 (GMT)
commit34fd1c9ac5845d541e3196983df7f993e751b544 (patch)
treee02022fb81d410dd0d897888fbafb5a0b1df1603
parent0dec30b9788b12fdae5d5b69fc366a28bb688d80 (diff)
downloadgit-34fd1c9ac5845d541e3196983df7f993e751b544.zip
git-34fd1c9ac5845d541e3196983df7f993e751b544.tar.gz
git-34fd1c9ac5845d541e3196983df7f993e751b544.tar.bz2
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>
-rw-r--r--pager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pager.c b/pager.c
index e5ba273..f7b8e78 100644
--- a/pager.c
+++ b/pager.c
@@ -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);
}