git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] branch: colour upstream branches

From
Thomas Rast <trast@inf.ethz.ch>
Date
Apr 14, 2013, 19:07 UTC
Message-ID
<87li8lylql.fsf@hexa.v.cablecom.net>
In-Reply-To
<1365903985-24920-1-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 27 quoted lines
> It's hard to see them among so much output otherwise.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  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
Previous: Felipe ContrerasNext: Duy Nguyen
Message 2 of 10 in “branch: colour upstream branches”
  1. branch: colour upstream branchesFelipe Contreras, Apr 14, 2013
  2. Thomas RastApr 14, 2013
  3. Duy NguyenApr 14, 2013
  4. Felipe ContrerasApr 14, 2013
  5. Duy NguyenApr 14, 2013
  6. Felipe ContrerasApr 14, 2013
  7. Duy NguyenApr 15, 2013
  8. Felipe ContrerasApr 15, 2013
  9. Duy NguyenApr 15, 2013
  10. Felipe ContrerasApr 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.