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

[PATCH 0/3] blame: allow blame.coloring to specify both --color-lines and --color-by-age

From
Robert Estelle via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 2, 2023, 19:16 UTC
Message-ID
<pull.1449.git.git.1675365406.gitgitgadget@gmail.com>

The flags --color-lines and --color-by-age are not mutually exclusive, and both affect the output format of git blame. This adds a test verifying git blame's output when run with both, where previously they were only tested independently.

blame is then taught to accept multiple values from blame.coloring, so that both modes can be set by configuration. Previously, the config only permitted one (repeatedLines) or the other (highlightRecent), despite the command line accepting both flags independently. This is a backwards-compatible change that does not alter the interpretation of existing configuration.

The list-parsing logic was derived from that of parse_color_moved_ws in diff.c.

Robert Estelle (3):
  blame: add test for --color-lines + --color-by-age
  blame: document --color-{lines,by-age} config
  blame: support multiple values in blame.coloring
 Documentation/blame-options.txt |  4 ++
 Documentation/config/blame.txt  |  1 +
 builtin/blame.c                 | 47 ++++++++++++++++------
 t/t8012-blame-colors.sh         | 71 +++++++++++++++++++++++++++++++++
 4 files changed, 111 insertions(+), 12 deletions(-)
base-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1449%2Frwe%2Fblame-color-config-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1449/rwe/blame-color-config-v1
Pull-Request: https://github.com/git/git/pull/1449
-- 
gitgitgadget
Next: Robert Estelle via GitGitGadget
Message 1 of 4 in “blame: allow blame.coloring to specify both --color-lines and --color-by-age”
  1. 0/3 blame: allow blame.coloring to specify both --color-lines and --color-by-ageRobert Estelle via GitGitGadget, Feb 2, 2023
  2. 1/3 blame: add test for --color-lines + --color-by-ageRobert Estelle via GitGitGadget, Feb 2, 2023
  3. 2/3 blame: document --color-{lines,by-age} configRobert Estelle via GitGitGadget, Feb 2, 2023
  4. 3/3 blame: support multiple values in blame.coloringRobert Estelle via GitGitGadget, Feb 2, 2023

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.