git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-log produces no output

From
Junio C Hamano <junkio@cox.net>
Date
Apr 21, 2006, 20:05 UTC
Message-ID
<7vpsjasnh5.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0604211223561.3701@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 7 quoted lines
> On Fri, 21 Apr 2006, Linus Torvalds wrote:
>> 
>> This patch would have made things a lot more obvious.
>
> Actually, scratch that one, and use this one instead. Much better, and 
> actually allows Bob's crazy PAGER environment variable to work, rather 
> than just reporting an error about it.
Agreed, this is much better than just punting.  Sign-off?
BTW: The extended extended SHA1 is a great addition.  I do not
usually have contrib/colordiff checked out (it is in "pu", not
in "next"), but I can easily do:
	git tar-tree pu:contrib/colordiff colordiff | tar xf -

Of course "git tar-tree pu | tar xf - contrib/colordiff" would work for this particular case, but that is besides the point.

BTW: Allow me to try "git fmt-patch -1" ;-).
-- >8 --
From 34fd1c9ac5845d541e3196983df7f993e751b544  Thu Apr 7 15:13:13 2005
From: Linus Torvalds <torvalds@osdl.org>
Date: Fri Apr 21 12:25:13 2006 -0700
Subject: 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>
---
 pager.c |    2 ++
 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 @@ #include "cache.h"
 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);
 }
-- 
1.3.0.gd1e3
Previous: Bob PortmannNext: Linus Torvalds
Message 9 of 10 in “git-log produces no output”
  1. Bob PortmannApr 21, 2006
  2. Linus TorvaldsApr 21, 2006
  3. Bob PortmannApr 21, 2006
  4. Paolo CiarrocchiApr 21, 2006
  5. Bob PortmannApr 21, 2006
  6. Linus TorvaldsApr 21, 2006
  7. Linus TorvaldsApr 21, 2006
  8. Bob PortmannApr 21, 2006
  9. Junio C HamanoApr 21, 2006
  10. Linus TorvaldsApr 21, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.