Git 2.3.0 (February 2015) will allow (thanks to Jeff Kink (peff
)):
parse_color
: support 24-bit RGB values
Some terminals (like XTerm) allow full 24-bit RGB color specifications using an extension to the regular ANSI color scheme.
Let's allow users to specify hex RGB colors, enabling the all-important feature of hot pink ref decorations:
git log --format="%h%C(#ff69b4)%d%C(reset) %s"
- a better management of color attributes:
parse_color
: recognize "no$foo
" to clear the $foo
attribute
You can turn on ANSI text attributes like "reverse" by putting "reverse" in your color spec. However, you cannot ask to turn reverse off.
For common cases, this does not matter. You would turn on "reverse" at the start of a colored section, and then clear all attributes with a "reset".
However, you may wish to turn on some attributes, then selectively disable others. For example:
git log --format="%C(bold ul yellow)%h%C(noul) %s"
underlines just the hash, but without the need to re-specify the rest of the attributes.
This can also help third-party programs, like contrib/diff-highlight
, that want to turn some attribute on/off without disrupting existing coloring.
Note that some attribute specifications are probably nonsensical (e.g., "bold nobold
"). We do not bother to flag such constructs, and instead let the terminal sort it out.
With Git 2.26 (Q1 2020), the basic 7 colors learned the brighter counterparts (e.g. "brightred
").
See commit c444f03, commit 1751b09, commit 4a28eb0 (21 Jan 2020) by Eyal Soha (``).
(Merged by Junio C Hamano -- gitster
-- in commit 87f17d7, 25 Feb 2020)
color.c
: support bright aixterm colors
Signed-off-by: Eyal Soha
These colors are the bright variants of the 3-bit colors.
Instead of 30-37 range for the foreground and 40-47 range for the background, they live in 90-97 and 100-107 range, respectively.
The git config
documentation now includes:
The basic colors accepted are normal
, black
, red
, green
, yellow
,
blue
, magenta
, cyan
and white
.
The first color given is the foreground; the second is the background.
All the basic colors except normal
have a bright variant that can be specified by prefixing the color with bright
, like brightred
.