]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/ansi-color'
authorJunio C Hamano <gitster@pobox.com>
Mon, 11 Jul 2016 17:31:05 +0000 (10:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Jul 2016 17:31:05 +0000 (10:31 -0700)
The output coloring scheme learned two new attributes, italic and
strike, in addition to existing bold, reverse, etc.

* jk/ansi-color:
  color: support strike-through attribute
  color: support "italic" attribute
  color: allow "no-" for negating attributes
  color: refactor parse_attr
  add skip_prefix_mem helper
  doc: refactor description of color format
  color: fix max-size comment

1  2 
Documentation/config.txt
color.c
color.h
git-compat-util.h

index e208af118d9e0db34e88b9170de2c1f2ad338578,6882e7065aacdb0a8cb74edf7bd2d1ffdc84ef12..db05dec743d1ad9b6b2b4272417dc968f2d56f7f
@@@ -150,35 -147,35 +150,42 @@@ integer:
         1024", "by 1024x1024", etc.
  
  color::
-        The value for a variables that takes a color is a list of
-        colors (at most two) and attributes (at most one), separated
-        by spaces.  The colors accepted are `normal`, `black`,
-        `red`, `green`, `yellow`, `blue`, `magenta`, `cyan` and
-        `white`; the attributes are `bold`, `dim`, `ul`, `blink` and
-        `reverse`.  The first color given is the foreground; the
-        second is the background.  The position of the attribute, if
-        any, doesn't matter. Attributes may be turned off specifically
-        by prefixing them with `no` (e.g., `noreverse`, `noul`, etc).
+        The value for a variable that takes a color is a list of
+        colors (at most two, one for foreground and one for background)
+        and attributes (as many as you want), separated by spaces.
  +
- Colors (foreground and background) may also be given as numbers between
- 0 and 255; these use ANSI 256-color mode (but note that not all
- terminals may support this).  If your terminal supports it, you may also
- specify 24-bit RGB values as hex, like `#ff0ab3`.
+ 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.
  +
- The attributes are meant to be reset at the beginning of each item
- in the colored output, so setting color.decorate.branch to `black`
- will paint that branch name in a plain `black`, even if the previous
- thing on the same output line (e.g. opening parenthesis before the
- list of branch names in `log --decorate` output) is set to be
- painted with `bold` or some other attribute.
+ Colors may also be given as numbers between 0 and 255; these use ANSI
+ 256-color mode (but note that not all terminals may support this).  If
+ your terminal supports it, you may also specify 24-bit RGB values as
+ hex, like `#ff0ab3`.
+ +
+ The accepted attributes are `bold`, `dim`, `ul`, `blink`, `reverse`,
+ `italic`, and `strike` (for crossed-out or "strikethrough" letters).
+ The position of any attributes with respect to the colors
+ (before, after, or in between), doesn't matter. Specific attributes may
+ be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`,
+ `no-ul`, etc).
+ +
+ For git's pre-defined color slots, the attributes are meant to be reset
+ at the beginning of each item in the colored output. So setting
+ `color.decorate.branch` to `black` will paint that branch name in a
+ plain `black`, even if the previous thing on the same output line (e.g.
+ opening parenthesis before the list of branch names in `log --decorate`
+ output) is set to be painted with `bold` or some other attribute.
+ However, custom log formats may do more complicated and layered
+ coloring, and the negated forms may be useful there.
  
 +pathname::
 +      A variable that takes a pathname value can be given a
 +      string that begins with "`~/`" or "`~user/`", and the usual
 +      tilde expansion happens to such a string: `~/`
 +      is expanded to the value of `$HOME`, and `~user/` to the
 +      specified user's home directory.
 +
  
  Variables
  ~~~~~~~~~
diff --cc color.c
Simple merge
diff --cc color.h
Simple merge
Simple merge