author | Andy Parkins <andyparkins@gmail.com> | |
Tue, 12 Dec 2006 06:41:52 +0000 (06:41 +0000) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 12 Dec 2006 08:56:25 +0000 (00:56 -0800) | ||
commit | a1158caeadec4d48b185068f4120d85423de5970 | |
tree | 4a058582dde034ca8145999660f3b4f9c189b453 | tree | snapshot |
parent | 6f9872582246b9b8ee4bdc9f6a563b409aab1ecb | commit | diff |
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>
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 | diff | blob | history |