Re: [PATCH] branch: colour upstream branches
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 14, 2013, 22:31 UTC
- Message-ID
- <CACsJy8DdBkPDXORxv08cFi+i5Q4WiBjjbNf9GyB4hv+t-K=wRQ@mail.gmail.com>
- In-Reply-To
- <1365903985-24920-1-git-send-email-felipe.contreras@gmail.com>
On Sun, Apr 14, 2013 at 11:46 AM, Felipe Contreras <felipe.contreras@gmail.com> wrote:
Show 12 quoted lines
> + char fancy[80];
>
> - if (show_upstream_ref)
> + if (show_upstream_ref) {
> ref = shorten_unambiguous_ref(branch->merge[0]->dst, 0);
> + if (want_color(branch_use_color))
> + snprintf(fancy, sizeof(fancy), "%s%s%s",
> + GIT_COLOR_BLUE, ref, GIT_COLOR_RESET);
> + else
> + strncpy(fancy, ref, sizeof(fancy));
> + }
> +Please use strbuf for "fancy". I also agree with Thomas that the color should not be hard coded. -- Duy