]> git.ipfire.org Git - thirdparty/git.git/commitdiff
blame: document --color-* options
authorBagas Sanjaya <bagasdotme@gmail.com>
Fri, 8 Oct 2021 09:16:14 +0000 (16:16 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Oct 2021 21:05:43 +0000 (14:05 -0700)
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>
Documentation/blame-options.txt
Documentation/config/color.txt
Documentation/git-blame.txt

index dc3bceb6d1cad4f14bc00ace9618716dd459cb04..de989e24d7edf3dc74aba2d96edbbfc638af3923 100644 (file)
@@ -136,5 +136,16 @@ take effect.
        option.  An empty file name, `""`, will clear the list of revs from
        previously processed files.
 
+--color-lines::
+       Color line annotations in the default format differently if they come from
+       the same commit as the preceding line. This makes it easier to distinguish
+       code blocks introduced by different commits. The color defaults to cyan and
+       can be adjusted using the `color.blame.repeatedLines` config option.
+
+--color-by-age::
+       Color line annotations depending on the age of the line in the default format.
+       The `color.blame.highlightRecent` config option controls what color is used for
+       each range of age.
+
 -h::
        Show help message.
index d5daacb13a2c77160accac4e46b1381cf8214f24..9fd7c1555b188c1b39db0455825360b3852de24a 100644 (file)
@@ -9,26 +9,29 @@ color.advice.hint::
        Use customized color for hints.
 
 color.blame.highlightRecent::
-       This can be used to color the metadata of a blame line depending
-       on age of the line.
+       Specify the line annotation color for `git blame --color-by-age`
+       depending upon the age of the line.
 +
-This setting should be set to a comma-separated list of color and date settings,
-starting and ending with a color, the dates should be set from oldest to newest.
-The metadata will be colored given the colors if the line was introduced
-before the given timestamp, overwriting older timestamped colors.
+This setting should be set to a comma-separated list of color and
+date settings, starting and ending with a color, the dates should be
+set from oldest to newest. The metadata will be colored with the
+specified colors if the line was introduced before the given
+timestamp, overwriting older timestamped colors.
+
 +
-Instead of an absolute timestamp relative timestamps work as well, e.g.
-2.weeks.ago is valid to address anything older than 2 weeks.
+Instead of an absolute timestamp relative timestamps work as well,
+e.g. `2.weeks.ago` is valid to address anything older than 2 weeks.
+
 +
-It defaults to 'blue,12 month ago,white,1 month ago,red', which colors
-everything older than one year blue, recent changes between one month and
-one year old are kept white, and lines introduced within the last month are
-colored red.
+It defaults to `blue,12 month ago,white,1 month ago,red`, which
+colors everything older than one year blue, recent changes between
+one month and one year old are kept white, and lines introduced
+within the last month are colored red.
 
 color.blame.repeatedLines::
-       Use the customized color for the part of git-blame output that
-       is repeated meta information per line (such as commit id,
-       author name, date and timezone). Defaults to cyan.
+       Use the specified color to colorize line annotations for
+       `git blame --color-lines`, if they come from the same commit as the
+       preceding line. Defaults to cyan.
 
 color.branch::
        A boolean to enable/disable color in the output of
index 2406790ebf7bb7e88f34900b8f276f111586a09e..52b99a2a499018511006918989858b10a1dcbed8 100644 (file)
@@ -11,8 +11,8 @@ SYNOPSIS
 'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
            [-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
            [--ignore-rev <rev>] [--ignore-revs-file <file>]
-           [--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>..<rev>]
-           [--] <file>
+           [--color-lines] [--color-by-age] [--progress] [--abbrev=<n>]
+           [<rev> | --contents <file> | --reverse <rev>..<rev>] [--] <file>
 
 DESCRIPTION
 -----------