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

Re: [PATCH/RFC] Fix for default pager

From
Dario Rodriguez <soft.d4rio@gmail.com>
Date
Jun 8, 2010, 14:39 UTC
Message-ID
<AANLkTilWg8hw5j20o-xGsVO-q_OeSmtKEKAO6O416qvH@mail.gmail.com>
In-Reply-To
<4C0E5103.7030501@viscovery.net>
On Tue, Jun 8, 2010 at 11:17 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 13 quoted lines
> 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.
>
As I said in the original thread...

$ PAGER=/nothing/here ../git log $ echo $? 0

$ GIT_PAGER=/nothing/here ../git log $ echo $? 0

That's on AIX 5.2
Show 23 quoted lines
> 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
>
Curious... I patched it on AIX and I get:
$ GIT_PAGER=/nothing/here ../git log
error: cannot run /nothing/here: No such file or directory
commit 3274a12f940680612e3bfd3d022a0eab460c0f1f
Author: usuario ####### <#######@Maquina01.(none)>
Date:   Thu Jun 3 20:02:23 2010 +0200
    OtherCom
commit acf110f7c878a37e4a5af8499134df28da0e8ab3
Author: usuario ####### <#######@Maquina01.(none)>
Date:   Thu Jun 3 20:01:37 2010 +0200
    inicial

However, the patch must delete the pager_preexec definition too... but I wonder, do somebody still need it?

btw: I still think 'more' is much more sane fallback default than 'less'... look (with your patch applied):

$ ../git log
error: cannot run less: No such file or directory
commit 3274a12f940680612e3bfd3d022a0eab460c0f1f
Author: ####### <#######@Maquina01.(none)>
Date:   Thu Jun 3 20:02:23 2010 +0200
    OtherCom
commit acf110f7c878a37e4a5af8499134df28da0e8ab3
Author: ####### <#######@Maquina01.(none)>
Date:   Thu Jun 3 20:01:37 2010 +0200
    inicial
Previous: Johannes SixtNext: Johannes Sixt
Message 7 of 29 in “Fix for default pager”
  1. Fix for default pagerDario Rodriguez, Jun 7, 2010
  2. Ben WaltonJun 8, 2010
  3. Dario RodriguezJun 8, 2010
  4. Jeff KingJun 8, 2010
  5. Dario RodriguezJun 8, 2010
  6. Johannes SixtJun 8, 2010
  7. Dario RodriguezJun 8, 2010
  8. Johannes SixtJun 8, 2010
  9. Dario RodriguezJun 8, 2010
  10. Johannes SixtJun 8, 2010
  11. Dario RodriguezJun 8, 2010
  12. Andreas EricssonJun 8, 2010
  13. Tor ArntsenJun 9, 2010
  14. Miles BaderJun 9, 2010
  15. Jeff KingJun 10, 2010
  16. Tor ArntsenJun 10, 2010
  17. Jeff KingJun 10, 2010
  18. Tor ArntsenJun 10, 2010
  19. Dario RodriguezJun 10, 2010
  20. Junio C HamanoJun 10, 2010
  21. Brandon CaseyJun 15, 2010
  22. Tor ArntsenJun 15, 2010
  23. Nazri RamliyJun 16, 2010
  24. Jeff KingJun 16, 2010
  25. Ævar Arnfjörð BjarmasonJun 9, 2010
  26. Jeff KingJun 8, 2010
  27. Johannes SixtJun 8, 2010
  28. Dario RodriguezJun 8, 2010
  29. Erik Faye-LundJun 8, 2010

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.