Jeff King <peff@xxxxxxxx> 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. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html