All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Will Palmer <wmpalmer@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net
Subject: Re: [PATCH v2 1/3] pretty: add conditional %C?colorname placeholders
Date: Sun, 25 Apr 2010 21:13:47 -0500	[thread overview]
Message-ID: <20100426021347.GA29669@progeny.tock> (raw)
In-Reply-To: <1272232579-18895-2-git-send-email-wmpalmer@gmail.com>

Hi Will,

Will Palmer wrote:

> Here we add the %C?colorname placeholders which act just as the
> %Ccolorname placeholders, with the exception that the pretty_context is
> checked to see if color should be used according to configuration

Thanks for tackling this.

I have thought a little about a related problem: some commands have
configuration for the colors they use, like:

    color.grep.<slot>
        Use customized color for grep colorization.  <slot> specifies which
        part of the line to use the specified color, and is one of

        context
            non-matching text in context lines (when using -A, -B, or -C)

        filename
            filename prefix (when not using -h)

This is nice because in certain situations (e.g. different background
colors), the default colors might not be suitable.  As an example of
this, the ‘commit ’ line of ‘git log’ output uses color.diff.commit.

So it would be nice to be able to use %C(diff.commit) and
automatically use the right color, if color is enabled.

Why not make %C always check?  I can understand that it would be
annoying when first trying to use %C.  On the other hand, it would be
more convenient for writing format.pretty configuration that should be
shared with old git, and I assume anyone using %C for the first time
would be looking at the manual, which could warn her.

Cheers,
Jonathan

  parent reply	other threads:[~2010-04-26  2:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 21:56 [PATCH v2 0/3] pretty: format aliases Will Palmer
2010-04-25 21:56 ` [PATCH v2 1/3] pretty: add conditional %C?colorname placeholders Will Palmer
2010-04-25 21:56   ` [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit] Will Palmer
2010-04-25 21:56     ` [PATCH v2 3/3] pretty: add aliases for pretty formats Will Palmer
2010-04-26  7:25       ` Jonathan Nieder
2010-04-26  8:15         ` Will Palmer
2010-04-26 22:11         ` Will Palmer
2010-04-26  3:11     ` [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit] Jonathan Nieder
2010-04-26  3:31       ` Jeff King
2010-04-26  3:38         ` Jonathan Nieder
2010-04-26  3:41           ` Jonathan Nieder
2010-04-26  3:45             ` Jeff King
2010-04-26  3:42           ` Jeff King
2010-04-26  7:47       ` Will Palmer
2010-04-26  9:53         ` Jonathan Nieder
2010-04-26  9:58           ` [PATCH 1/4] t4201 (shortlog): guard setup with test_expect_success Jonathan Nieder
2010-04-26  9:59           ` [PATCH 2/4] t4201 (shortlog): Test output format with multiple authors Jonathan Nieder
2010-04-26  9:59           ` [PATCH 3/4] shortlog: Document and test --format option Jonathan Nieder
2010-04-26 10:00           ` [PATCH 4/4] pretty: Respect --abbrev option Jonathan Nieder
2010-04-26 10:13           ` [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit] Will Palmer
2010-04-26 10:19             ` Jonathan Nieder
2010-04-26 10:23               ` Will Palmer
2010-04-26 10:28                 ` Jonathan Nieder
2010-04-26  2:13   ` Jonathan Nieder [this message]
2010-04-26  3:26     ` [PATCH v2 1/3] pretty: add conditional %C?colorname placeholders Jeff King
2010-04-26  4:14       ` Jonathan Nieder
2010-04-26 14:28         ` 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=20100426021347.GA29669@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=wmpalmer@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 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.