From: Junio C Hamano Date: Sun, 06 Jan 2008 12:32:15 GMT Subject: Re: What's in git.git (stable frozen) Message-ID: <7vy7b33zjk.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080106111725.GA11603@coredump.intra.peff.net> Jeff King writes: > Something like this (instead of my last patch): Yeah, I like that much better, especially the renaming of $use_color to more descriptive (but is it really about "menu", I wonder?). I might consider rewriting this part > +my $menu_use_color = $repo->get_colorbool('color.interactive'); > +my ($prompt_color, $header_color, $help_color) = > + $menu_use_color ? ( > + $repo->get_color('color.interactive.prompt', 'bold blue'), > + $repo->get_color('color.interactive.header', 'bold'), > + $repo->get_color('color.interactive.help', 'red bold'), > + ) : (); like this: my ($prompt_color, $header_color, $help_color, $fraginfo_color); if ($colored_prompt) { $prompt_color = ...; $header_color = ...; } if ($colored_diff) { $fraginfo_color = ...; } or even like this: my (%palette); if ($colored_prompt) { my %default = ( prompt => 'bold blue', header => 'bold', ... ); while (my ($k,$v) = each %default) { $palette{$k} = $repo->get_color("color.interactive.$k",$v); } } But I realize that's going overboard. Certainly the last one is doing unnecessary generalization for generalization's sake.