Re: [PATCH 4/5] Let git-add--interactive read colors from configuration

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Dan Zwell <dzwell@...>
Cc: Junio C Hamano <gitster@...>, Git Mailing List <git@...>, Shawn O. Pearce <spearce@...>, Wincent Colaiuta <win@...>, Jonathan del Strother <maillist@...>, Johannes Schindelin <Johannes.Schindelin@...>, Frank Lichtenheld <frank@...>, Jakub Narebski <jnareb@...>
Date: Friday, November 23, 2007 - 5:09 am

On Thu, Nov 22, 2007 at 11:32:16PM -0600, Dan Zwell wrote:


I think that is more elegant for config_bool, but it means that
config_bool and config_color have slightly different behaviors (the
difference being that it is easy to feed a native perl value as the
default to config_bool, but to get the same behavior for config_color,
you would call Git::color_to_ansi_code manually, which is a pain).

In this instance, I am inclined to sacrifice consistency for convenience
and make it:

   my $bool = config_bool('my.key', 0);
   my $color = config_color('my.key', 'bold red');

Note that there is one tricky part of config_bool, which is what
config_bool('my.key', undef) should do (is it "default false" or "no
default"?).

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Color support added to git-add--interactive., Dan Zwell, (Sat Oct 13, 12:13 am)
Re: [PATCH] Color support added to git-add--interactive., Johannes Schindelin, (Sat Oct 13, 8:25 am)
Re: [PATCH] Color support added to git-add--interactive., Frank Lichtenheld, (Sat Oct 13, 8:49 am)
Re: [PATCH] Color support added to git-add--interactive., Wincent Colaiuta, (Sat Oct 13, 10:45 am)
Re: [PATCH] Color support added to git-add--interactive., Johannes Schindelin, (Sat Oct 13, 12:38 pm)
Re: [PATCH] Color support added to git-add--interactive., Jean-Luc Herren, (Sat Oct 13, 12:38 pm)
Re: [PATCH] Color support added to git-add--interactive., Wincent Colaiuta, (Sat Oct 13, 1:14 pm)
Re: [PATCH] Color support added to git-add--interactive., Andreas Ericsson, (Sat Oct 13, 2:31 pm)
Re: [PATCH] Color support added to git-add--interactive., Wincent Colaiuta, (Sat Oct 13, 4:36 pm)
Re: [PATCH] Color support added to git-add--interactive., Jean-Luc Herren, (Sat Oct 13, 6:23 pm)
[PATCH 0/3] Adding colors to git-add--interactive, Dan Zwell, (Sat Nov 10, 10:21 pm)
[PATCH 0/3] Adding colors to git-add--interactive, Dan Zwell, (Sat Nov 10, 8:01 pm)
Re: [PATCH 4/5] Let git-add--interactive read colors from co..., Jeff King, (Fri Nov 23, 5:09 am)
[PATCH 0/5] Colors for git-add--interactive, Dan Zwell, (Thu Nov 22, 6:54 am)
Re: [PATCH 0/5] Colors for git-add--interactive, Junio C Hamano, (Thu Nov 22, 3:20 pm)
Re: [PATCH 0/5] Colors for git-add--interactive, Jeff King, (Thu Nov 22, 7:57 am)
Re: [PATCH 0/3] Adding colors to git-add--interactive, Junio C Hamano, (Sun Nov 11, 4:23 am)