git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH] blame: document --color-* options

From
Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>
Date
Sep 28, 2021, 12:38 UTC
Message-ID
<4078bebf2da14e5f8fc80a5ac7918151@ncp-e.com>
In-Reply-To
<fe78329d-07a7-bdf3-2bda-13def35f3de3@gmail.com>

Thank you Bagas for adding the documentation. I think the only that disturbed Junio is the use of the word "metadata", which is used internally, but not in the official documentation aimed at the git user.

Starting from your patch, I added some suggestions for alternative wordings.

Regards, Matthias

commit ae2c59b7c76d9201d68aeb21b0ce57f2845732a1
Author: Bagas Sanjaya <bagasdotme@gmail.com>
Date:   Tue Sep 28 10:11:23 2021 +0200
    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>
diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt
index 117f4cf806..1560f2b6df 100644
--- a/Documentation/blame-options.txt
+++ b/Documentation/blame-options.txt
@@ -136,5 +136,15 @@ take effect.
 option.  An empty file name, `""`, will clear the list of revs from
 previously processed files.

+--color-lines::
+Color lines differently if they belong to the same commit as the preceding line.
+This facilitates distinguishing code blocks introduced by different commits.
+The color defaults to cyan and be adjusted using the `color.blame.repeatedLines`
+config option.
+
+--color-by-age::
+Color lines depending on the age of the line. The `color.blame.highlightRecent`
+config option controls what color is used for which range of age.
+
 -h::
 Show help message.
diff --git a/Documentation/config/color.txt b/Documentation/config/color.txt
index e05d520a86..a1cf36fc89 100644
--- a/Documentation/config/color.txt
+++ b/Documentation/config/color.txt
@@ -9,8 +9,8 @@ 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.
+Used to color line annotations differently depending on the age of the commit
+(`git blame --color-by-age`).
 +
 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.
@@ -25,10 +25,9 @@ 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.
+color.blame.repeated
+Use this color to colorize line annotations, if they belong to the same commit
+as the preceding line (`git blame --color-lines`). Defaults to cyan.

 color.branch::
 A boolean to enable/disable color in the output of
diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
index 3bf5d5d8b4..cfdbad030b 100644
--- a/Documentation/git-blame.txt
+++ b/Documentation/git-blame.txt
@@ -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
 -----------


Dr. Matthias St. Pierre
Tech Lead Cryptography
matthias.st.pierre@ncp-e.com
Phone: +49 911 9968-0
 www.ncp-e.com

Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 • Nuremberg
North American HQ: NCP engineering Inc. • 601 Cleveland Str., Suite 501-25 • Clearwater, FL 33755

Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich
Registry Court: Lower District Court of Nuremberg
Commercial register No.: HRB 7786 Nuremberg, VAT identification No.: DE 133557619

This e-mail message including any attachments is for the sole use of the intended recipient(s) and may contain privileged
or confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient,
please immediately contact the sender by reply e-mail and delete the original message and destroy all copies thereof.
Previous: Bagas SanjayaNext: Bagas Sanjaya
Message 6 of 14 in “git-blame: '--color-by-age' option not documented in manual page”
  1. Dr. Matthias St. PierreSep 24, 2021
  2. blame: document --color-* optionsBagas Sanjaya, Sep 25, 2021
  3. Bagas SanjayaSep 25, 2021
  4. Junio C HamanoSep 27, 2021
  5. Bagas SanjayaSep 28, 2021
  6. Dr. Matthias St. PierreSep 28, 2021
  7. Bagas SanjayaSep 29, 2021
  8. Dr. Matthias St. PierreSep 29, 2021
  9. Bagas SanjayaSep 29, 2021
  10. Dr. Matthias St. PierreSep 29, 2021
  11. Dr. Matthias St. PierreSep 29, 2021
  12. Junio C HamanoSep 28, 2021
  13. Bagas SanjayaSep 29, 2021
  14. Junio C HamanoSep 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.