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

[PATCH/RFC] Pro-Git thanks, Control-flow bug report

From
SNSteffen Daode Nurpmeso <sdaoden@googlemail.com>
Date
Jul 25, 2011, 12:50 UTC
Message-ID
<20110725125037.GA24198@sherwood.local>
Hello git(1),

first of all i have to say thanks to the guy who brought up Pro-Git on this list a few weeks ago! *Thank you, man*! I love this book, and i *adore* chapter 9! Beep beep actually beeping software! Yes!! (I hope you do this with adorable software only ... Such a beep. Beep.)

So while exploring git(1) i recently tried out colours (it's oh so coloured for a two, since 2011 three colors vim(1) user - fascinating) and found a control flow bug:

  ?0%0[steffen@sherwood git.git]$ ./git --version
  git version 1.7.6.233.gd79bc.dirty
  ?0%0[steffen@sherwood git.git]$ ./git -c color.ui=auto -c color.pager=false diff 2> AU; cat AU
  git_config_colorbool(color.ui,auto,-1)
    [pager_in_use(): spawned:0, GIT_PAGER_IN_USE:0]
    auto_color:1
    color acc. 2 getenv(TERM)
  git_default_config(color.pager,false): 0

So the pager is spawned after the color config setting has been queried (and the latter is never updated). I'm not aware of the codebase, and so i can't offer a patch, unfortunately. I tried the following change in color.c first, but that's not a solution for the real problem:

  jauto_color:
	if (pager_in_use())
		stdout_is_tty = pager_use_color;
	else if (stdout_is_tty < 0)
		stdout_is_tty = isatty(1);
	if (stdout_is_tty) {
		...
--Steffen
Ciao, sdaoden(*)(gmail.com)
ASCII ribbon campaign           ( ) More nuclear fission plants
  against HTML e-mail            X    can serve more coloured
    and proprietary attachments / \     and sounding animations
Next: Jeff King
Message 1 of 4 in “Pro-Git thanks, Control-flow bug report”
  1. Pro-Git thanks, Control-flow bug reportSteffen Daode Nurpmeso, Jul 25, 2011
  2. Jeff KingJul 25, 2011
  3. Steffen Daode NurpmesoJul 25, 2011
  4. Jeff KingJul 25, 2011

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.