Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: What's in git.git (stable frozen)

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:02

Jeff King [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help