Subject: Re: [PATCH/RFC] Fix for default pager

From: Johannes Sixt <[email-masked]>
Date: Tue, 08 Jun 2010 16:17:39 +0200

Am 6/8/2010 15:49, schrieb Dario Rodriguez:
> we must correct
> something... the other way is that if pager fails to execute, we
> cannot simply return 0.

But we do not return 0:

 $ GIT_PAGER=/is/not/there git log
 $ echo $?
 141

That's SIGPIPE, just as I would expect.

And with this change

diff --git a/pager.c b/pager.c
index dac358f..86519cc 100644
--- a/pager.c
+++ b/pager.c
@@ -89,9 +89,6 @@ void setup_pager(void)
 		static const char *env[] = { "LESS=FRSX", NULL };
 		pager_process.env = env;
 	}
-#ifndef WIN32
-	pager_process.preexec_cb = pager_preexec;
-#endif
 	if (start_command(&pager_process))
 	return;

I get:

 $ GIT_PAGER=/is/not/there ./git log -1 --oneline
 error: cannot run /is/not/there: No such file or directory
 1a16cee merge-recursive: demonstrate an incorrect conflict with submodule

-- Hannes