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

Re: [PATCH/RFC] Fix for default pager

From
Andreas Ericsson <ae@op5.se>
Date
Jun 8, 2010, 21:33 UTC
Message-ID
<4C0EB741.9020905@op5.se>
In-Reply-To
<AANLkTinB_SBilMOfgnHtDrQS-NBOLF4yY5NaP7ZvN9rK@mail.gmail.com>
On 06/08/2010 10:44 PM, Dario Rodriguez wrote:
Show 36 quoted lines
> On Tue, Jun 8, 2010 at 3:59 PM, Johannes Sixt<j.sixt@viscovery.net>  wrote:
>> Your repository has only 2 commits and its git log output is less than 1kB,
>> i.e., sufficiently small to fit in a pipe's buffer.
>>
>> git log calls start_command to fork() the pager. The OS's scheduler does not
>> run the newly forked process immediately; rather, git log goes on with its
>> own business, writing output to the pipe that connects to the pager. Because
>> your repository is so small, git log never has to wait that the pager drains
>> the pipe. git log finally reaches exit(0). At this time, an atexit() handler
>> (wait_for_pager()) finally calls finish_command() to wait for the pager.
>>
>> This is the first time that the forked child process can run. Only now it
>> turns out that the pager cannot be run. The child process closes the pipe
>> and exits with an error, but it is too late: wait_for_pager() drops the
>> error return code of finish_command() to the floor. The parent process (git
>> log) can complete with the exit code that it was given earlier, 0.
>>
>> Repeat your experiment with ./git log in git.git itself to see the
>> difference.
>>
>> -- Hannes
>>
> 
> Capisco&  touché, with much more than 1k of info, git show ends with a
> "Broken Pipe"... seems hard to detect for little, recently started
> projects since I added more than 60k of scripts and I need to do 'git
> show' to understand that the problem is a broken pipe.
> 
> Now, let me think about it... do we need the pager_preexec function? I
> mean... it works fine without it, and the function is there because of
> a faulty 'less'.
> 
> My problem is obvioulsly solved by adding PAGER=more in my default
> environment, but I think this could be a litle bit embarrassing for a
> new user, mostly in environments such this AIX :P
> 

Catering to AIX by default seems stupid beyond belief. AIX users today are, without fail, accustomed to having to tweak more or less everything to make the system run smoothly with modern applications (where "modern" is a generous term, including everything that's been written in the last 10 or so years).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Dario RodriguezNext: Tor Arntsen
Message 12 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.