Colourise git-branch output
commita1158caeadec4d48b185068f4120d85423de5970
authorAndy Parkins <andyparkins@gmail.com>
Tue, 12 Dec 2006 06:41:52 +0000 (12 06:41 +0000)
committerJunio C Hamano <junkio@cox.net>
Tue, 12 Dec 2006 08:56:25 +0000 (12 00:56 -0800)
tree4a058582dde034ca8145999660f3b4f9c189b453
parent6f9872582246b9b8ee4bdc9f6a563b409aab1ecb
Colourise git-branch output

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.

I've based it off the colouring code for builtin-diff.c; which means
there is a branch color configuration variable that needs setting to
something before the color will appear.

The colour parameter is "color.branch" rather than "branch.color" to
avoid clashing with the default namespace for default branch merge
definitions.

This patch chooses green for local, red for remote and bold green for
current.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-branch.c