From: Junio C Hamano Date: Fri, 03 Nov 2006 19:25:59 GMT Subject: Re: [PATCH] Colourise git-branch output Message-ID: <7v3b908h88.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <200611031206.12515.andyparkins@gmail.com> Andy Parkins writes: > I wanted to have a visual indication of which branches are > local and which are remote in git-branch -a output; however > Junio was concerned that someone might be using the output in > a script. This patch addresses the problem by colouring the > git-branch output - which in "auto" mode won't be activated. Yuck. We are getting more and more color happy. As long as this stays optional I'm Ok with it; we'll see if people find it useful soon enough. > @@ -165,11 +199,28 @@ static void print_ref_list( int type_wan > qsort(ref_list.list, ref_list.index, sizeof(struct ref_item), ref_cmp); > > for (i = 0; i < ref_list.index; i++) { > + switch( ref_list.list[i].type ) { > + case REF_LOCAL_BRANCH: > + color = COLOR_BRANCH_LOCAL; > + break; Style. SP between "switch" and open parenthesis, no SP after that open parenthesis. We tend to align "switch", "case", and "default" on the same column.