git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Mark Lodato <lodatom@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Add an optional argument for --color options
Date: Mon, 15 Feb 2010 00:23:56 -0500	[thread overview]
Message-ID: <20100215052356.GI3336@coredump.intra.peff.net> (raw)
In-Reply-To: <20100215011803.GA15966@progeny.tock>

On Sun, Feb 14, 2010 at 07:18:04PM -0600, Jonathan Nieder wrote:

> > Perhaps I can throw the tests in Jonathan's "tests for automatic use
> > of pager", t7006-pager?  Or, create a new test that mimics his?
> 
> I would suggest copying whatever functions you need to a new
> lib-terminal.sh and sourcing that with . from a new test.  Then I
> could adapt t7006-pager to use your library and avoid duplication of
> code.

Yes, I think that is a reasonable way to go.

> I am also interested in feedback on the techniques used in that test.
> Should it just rely on redirects to /dev/tty instead, and work to
> avoid sending any actual output there?  Is there an easier way to
> detect use of color?

Keep in mind that you might not even have a terminal at all (e.g., tests
run from a cron job), so redirecting /dev/tty won't help there. It is
easy enough to fake, as I posted in the other thread, so I think that is
probably simplest (unless we go with the "it only works under
--verbose" scheme).

-Peff

  reply	other threads:[~2010-02-15  5:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 22:01 [PATCH] Add an optional argument for --color options Mark Lodato
2010-02-14  6:44 ` Jeff King
2010-02-14 12:21   ` Jonathan Nieder
2010-02-14 14:58   ` Mark Lodato
2010-02-15  1:18     ` Jonathan Nieder
2010-02-15  5:23       ` Jeff King [this message]
2010-02-15  1:23     ` Usage messages produced by parseopt (Re: [PATCH] Add an optional argument for --color options) Jonathan Nieder
2010-02-15  5:21     ` [PATCH] Add an optional argument for --color options Jeff King
2010-02-15  6:02       ` Junio C Hamano
2010-02-14 11:39 ` Junio C Hamano
2010-02-14 14:46   ` Mark Lodato

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=20100215052356.GI3336@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=lodatom@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).