All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Daode Nurpmeso <sdaoden@googlemail.com>
To: git@vger.kernel.org
Subject: [PATCH/RFC] Pro-Git thanks, Control-flow bug report
Date: Mon, 25 Jul 2011 14:50:38 +0200	[thread overview]
Message-ID: <20110725125037.GA24198@sherwood.local> (raw)

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

             reply	other threads:[~2011-07-25 12:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 12:50 Steffen Daode Nurpmeso [this message]
2011-07-25 16:25 ` [PATCH/RFC] Pro-Git thanks, Control-flow bug report Jeff King
2011-07-25 19:39   ` Steffen Daode Nurpmeso
2011-07-25 19:49     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110725125037.GA24198@sherwood.local \
    --to=sdaoden@googlemail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.