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

Re: git status in clean working dir

From
Jeff King <peff@peff.net>
Date
Jul 22, 2008, 09:40 UTC
Message-ID
<20080722094054.GA5720@sigill.intra.peff.net>
In-Reply-To
<7viquymg5k.fsf@gitster.siamese.dyndns.org>
On Tue, Jul 22, 2008 at 02:17:43AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Another slight worry I have is if the now-parent git process does the
> right thing when the user kills the pager without viewing the output to
> the end.  git itself will get stuck with write() while the user is
> reading, and then notice that the pipe does not have any more reader when
> the pager is killed.  This fact itself won't change by swapping the
> parent-child relationship, but would we get a sensible behaviour after
> that, or have we been ignoring what happens afterwards only because our
> exit status has been hidden behind the pager?  Running "git log" and
> killing it by "q" (my pager is "less") makes it exit with 141.

Hmm, good point. Though previously in this case, we were getting whatever code the pager provided. Which means nobody probably cared that much. Though I suppose that people who use "$?" in their prompt might see scariness.

> I shouldn't worry, if everything is written correctly in the other parts
> of the system, this swap should not have much ill effect.

I am a little unhappy about the git process hanging around, but I don't know if it is worth making a meta-process just to manage the pager.

Also, I think people with a pager that has spaces in in it will now need to quote it (e.g., PAGER="/path with space/less" used to work, but now is passed to the shell). Arguably, this brings it in line with other spawned programs, like EDITOR, but it is a difference, and we are in release freeze. That could be fixed with some magic in run_command. (Note that it has always been run by the shell under Windows, so again, this is making things more consistent).

> By the way [2/2] was not signed-off.  Just forgotten?

Yes, forgotten. If you are planning on applying, please forge (and squash the portability fix).

-Peff
Previous: Junio C HamanoNext: David Bremner
Message 24 of 30 in “git status in clean working dir”
  1. David BremnerJul 21, 2008
  2. Junio C HamanoJul 22, 2008
  3. Abhijit Menon-SenJul 22, 2008
  4. Junio C HamanoJul 22, 2008
  5. Junio C HamanoJul 22, 2008
  6. Jeff KingJul 22, 2008
  7. Jeff KingJul 22, 2008
  8. Johannes SchindelinJul 22, 2008
  9. Jeff KingJul 22, 2008
  10. Mike HommeyJul 22, 2008
  11. Jeff KingJul 22, 2008
  12. Mike HommeyJul 22, 2008
  13. Jeff KingJul 22, 2008
  14. Jeff KingJul 22, 2008
  15. 1/2 run-command: add pre-exec callbackJeff King, Jul 22, 2008
  16. 2/2 spawn pager via run_command interfaceJeff King, Jul 22, 2008
  17. Jeff KingJul 22, 2008
  18. Pierre HabouzitJul 22, 2008
  19. Jeff KingJul 22, 2008
  20. Johannes SixtJul 22, 2008
  21. Jeff KingJul 22, 2008
  22. Johannes SixtJul 22, 2008
  23. Junio C HamanoJul 22, 2008
  24. Jeff KingJul 22, 2008
  25. David BremnerJul 22, 2008
  26. Johannes SixtJul 22, 2008
  27. Jeff KingJul 22, 2008
  28. Johannes SixtJul 22, 2008
  29. Ask Bjørn HansenJul 24, 2008
  30. Jeff KingJul 24, 2008

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.