From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Markus Heidelberg <markus.heidelberg@web.de>, git@vger.kernel.org
Subject: Re: [PATCH] grep: don't support "grep.color"-like config options
Date: Mon, 20 Apr 2009 22:55:34 -0700 [thread overview]
Message-ID: <7vy6tua6uh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0904210145260.10279@pacific.mpi-cbg.de> (Johannes Schindelin's message of "Tue, 21 Apr 2009 01:45:41 +0200 (CEST)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Tue, 21 Apr 2009, Markus Heidelberg wrote:
>
>> color.grep and color.grep.* is the official and documented way to
>> highlight grep matches. Comparable options like diff.color.* and
>> status.color.* exist for backward compatibility reasons only and are not
>> documented any more.
>
> But is it really so bad that we have to possibly break existing setups?
>
> The cost of keeping them is really small IMHO.
While I do not think these lines themselves will cost us a lot of
maintenance effort, people tend to mimick existing code, and these
patterns can proliferate if unchecked, and *that* would add to
maintenance. As the feature has aleady been in master for 6 weeks or so,
Markus's patch is now-or-never, and I'd rather say we take it before the
1.6.3 final.
An alternative would be to:
(1) Keep them undocumented;
(2) add code comments about their deprecated status to discourage people
from copying the style; and
(3) possibly deprecate it in some future.
but I do not know if the last step is worth it.
In any case, I think perhaps we should squash this in.
diff.c | 5 +++++
wt-status.c | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 3ac7168..f2432de 100644
--- a/diff.c
+++ b/diff.c
@@ -79,6 +79,11 @@ static int git_config_rename(const char *var, const char *value)
*/
int git_diff_ui_config(const char *var, const char *value, void *cb)
{
+ /*
+ * Note: cmdname.color style of configuration variables are
+ * deprecated; do not copy this pattern but accept only
+ * color.cmdname in new code.
+ */
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
diff_use_color_default = git_config_colorbool(var, value, -1);
return 0;
diff --git a/wt-status.c b/wt-status.c
index 929b00f..9726e0b 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -381,6 +381,11 @@ int git_status_config(const char *k, const char *v, void *cb)
wt_status_submodule_summary = -1;
return 0;
}
+ /*
+ * Note: cmdname.color style of configuration variables are
+ * deprecated; do not copy this pattern but accept only
+ * color.cmdname in new code.
+ */
if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
wt_status_use_color = git_config_colorbool(k, v, -1);
return 0;
next prev parent reply other threads:[~2009-04-21 5:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-20 22:58 [PATCH] grep: don't support "grep.color"-like config options Markus Heidelberg
2009-04-20 23:45 ` Johannes Schindelin
2009-04-21 0:11 ` Markus Heidelberg
2009-04-21 5:55 ` Junio C Hamano [this message]
2009-04-21 7:57 ` Markus Heidelberg
2009-04-21 15:45 ` René Scharfe
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=7vy6tua6uh.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=markus.heidelberg@web.de \
/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).