Re: [PATCH] branch: colour upstream branches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:

> It's hard to see them among so much output otherwise.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
> ---
>  builtin/branch.c | 27 ++++++++++++++++++++-------
>  1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/builtin/branch.c b/builtin/branch.c
> index 00d17d2..a1cdc29 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -417,32 +417,45 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,
>  	int ours, theirs;
>  	char *ref = NULL;
>  	struct branch *branch = branch_get(branch_name);
> +	char fancy[80];
>  
>  	if (!stat_tracking_info(branch, &ours, &theirs)) {
>  		if (branch && branch->merge && branch->merge[0]->dst &&
> -		    show_upstream_ref)
> -			strbuf_addf(stat, "[%s] ",
> -			    shorten_unambiguous_ref(branch->merge[0]->dst, 0));
> +		    show_upstream_ref) {
> +			ref = shorten_unambiguous_ref(branch->merge[0]->dst, 0);
> +			if (want_color(branch_use_color))
> +				strbuf_addf(stat, "[%s%s%s] ",
> +						GIT_COLOR_BLUE, ref, GIT_COLOR_RESET);

AFAICS you are hardcoding the color?  The other bits of branch colors
are configurable through branch.color.*, so why not this?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]