From: Will Palmer <wmpalmer@gmail.com>
To: Thomas Egerer <thomas.egerer@secunet.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pretty.c: Make user defined format honor color option
Date: Thu, 17 Mar 2011 09:39:51 +0000 [thread overview]
Message-ID: <1300354791.3269.19.camel@wpalmer.simply-domain> (raw)
In-Reply-To: <4D81C741.8060108@secunet.com>
On Thu, 2011-03-17 at 09:33 +0100, Thomas Egerer wrote:
> This patch fixes that the pretty-formats tformat and format ignore
> git's color option.
It is my understanding that this is intentional, the logic being: If you
normally don't want color, but have specified it directly on the
command-line, you probably want color.
It is arguable that this logic does not hold for format aliases, of
course. (and personally I've never agreed with the above logic anyway)
iirc, there are a couple of other places beyond log-tree.c which need to
propagate COLOR_DIFF into the pretty context if you want to respect the
colour option in user-specified formats. Skimming my own diffs:
rev-list.c and shortlog.c
Of course, explicitly propagating "diff_opts" settings like this just
shows off how poorly named these things are if we're going to use them
for this sort of thing. That's probably a place for another patch,
though.
I've got a patch to add support for conditional formats, including such
things as: %(opt-color: %Cred%h%Creset, %h). I'm currently in the
process of re-rolling just the "long options" part of that into
something more-manageable, but honestly that's the bulk of the change,
so if that gets accepted then adding %(opt-color...) would be pretty
trivial.
--Will
next prev parent reply other threads:[~2011-03-17 9:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 8:33 [PATCH] pretty.c: Make user defined format honor color option Thomas Egerer
2011-03-17 9:39 ` Will Palmer [this message]
2011-03-17 12:02 ` Thomas Egerer
2011-03-17 12:59 ` Will Palmer
2011-03-17 19:49 ` Jeff King
2011-03-17 13:46 ` Thomas Egerer
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=1300354791.3269.19.camel@wpalmer.simply-domain \
--to=wmpalmer@gmail.com \
--cc=git@vger.kernel.org \
--cc=thomas.egerer@secunet.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).