blame: document --color-* options
Commit cdc2d5f11f1a (builtin/blame: dim uninteresting metadata lines, 2018-04-23) and 25d5f52901f0 (builtin/blame: highlight recently changed lines, 2018-04-23) introduce --color-lines and --color-by-age options to git blame, respectively. While both options are mentioned in usage help, they aren't documented in git-blame(1). Document them. Co-authored-by: Dr. Matthias St. Pierre <m.st.pierre@ncp-e.com> Signed-off-by: Dr. Matthias St. Pierre <m.st.pierre@ncp-e.com> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Bagas Sanjaya committed
Oct 8, 2021 at 16:16 UTC
8c3285613322f5b08c8a2320030f4e74b5032998
3 files changed
+31
-17
Documentation/blame-options.txt
+11
@@ -136,5 +136,16 @@ take effect.
136
option. An empty file name, `""`, will clear the list of revs from
137
previously processed files.
138
139
+--color-lines::
140
+ Color line annotations in the default format differently if they come from
141
+ the same commit as the preceding line. This makes it easier to distinguish
142
+ code blocks introduced by different commits. The color defaults to cyan and
143
+ can be adjusted using the `color.blame.repeatedLines` config option.
144
+
145
+--color-by-age::
146
+ Color line annotations depending on the age of the line in the default format.
147
+ The `color.blame.highlightRecent` config option controls what color is used for
148
+ each range of age.
149
+
150
-h::
151
Show help message.
Documentation/config/color.txt
+18
-15
@@ -9,26 +9,29 @@ color.advice.hint::
9
Use customized color for hints.
10
11
color.blame.highlightRecent::
12
- This can be used to color the metadata of a blame line depending
13
- on age of the line.
12
+ Specify the line annotation color for `git blame --color-by-age`
13
+ depending upon the age of the line.
14
+
15
-This setting should be set to a comma-separated list of color and date settings,
16
-starting and ending with a color, the dates should be set from oldest to newest.
17
-The metadata will be colored given the colors if the line was introduced
18
-before the given timestamp, overwriting older timestamped colors.
15
+This setting should be set to a comma-separated list of color and
16
+date settings, starting and ending with a color, the dates should be
17
+set from oldest to newest. The metadata will be colored with the
18
+specified colors if the line was introduced before the given
19
+timestamp, overwriting older timestamped colors.
20
+
21
+
20
-Instead of an absolute timestamp relative timestamps work as well, e.g.
21
-2.weeks.ago is valid to address anything older than 2 weeks.
22
+Instead of an absolute timestamp relative timestamps work as well,
23
+e.g. `2.weeks.ago` is valid to address anything older than 2 weeks.
24
+
25
+
23
-It defaults to 'blue,12 month ago,white,1 month ago,red', which colors
24
-everything older than one year blue, recent changes between one month and
25
-one year old are kept white, and lines introduced within the last month are
26
-colored red.
26
+It defaults to `blue,12 month ago,white,1 month ago,red`, which
27
+colors everything older than one year blue, recent changes between
28
+one month and one year old are kept white, and lines introduced
29
+within the last month are colored red.
30
31
color.blame.repeatedLines::
29
- Use the customized color for the part of git-blame output that
30
- is repeated meta information per line (such as commit id,
31
- author name, date and timezone). Defaults to cyan.
32
+ Use the specified color to colorize line annotations for
33
+ `git blame --color-lines`, if they come from the same commit as the
34
+ preceding line. Defaults to cyan.
35
36
color.branch::
37
A boolean to enable/disable color in the output of
Documentation/git-blame.txt
+2
-2
@@ -11,8 +11,8 @@ SYNOPSIS
11
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
12
[-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
13
[--ignore-rev <rev>] [--ignore-revs-file <file>]
14
- [--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>..<rev>]
15
- [--] <file>
14
+ [--color-lines] [--color-by-age] [--progress] [--abbrev=<n>]
15
+ [<rev> | --contents <file> | --reverse <rev>..<rev>] [--] <file>
16
17
DESCRIPTION
18
-----------