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

Re: [PATCH] pretty: colorize pattern matches in commit messages

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 5, 2021, 18:01 UTC
Message-ID
<CAPig+cQ2TDjdWd+xUEQ1OQAH8tBQTv=O73MdMOBf8GZ1LFbzDQ@mail.gmail.com>
In-Reply-To
<20210905120506.635130-1-someguy@effective-light.com>

On Sun, Sep 5, 2021 at 8:05 AM Hamza Mahfooz <someguy@effective-light.com> wrote:

Show 23 quoted lines
> [...]
> Teach the pretty-printer code to highlight matches from the
> "--grep=<pattern>", "--author=<pattern>" and "--committer=<pattern>"
> options (to view the last one, you may have to ask for --pretty=fuller).
>
> Signed-off-by: Hamza Mahfooz <someguy@effective-light.com>
> ---
> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
> @@ -232,6 +232,14 @@ notes.displayRef::
>         or `GIT_NOTES_REF`, to read notes from when showing commit
>         messages with the `log` family of commands.  See
>         linkgit:git-notes[1].
> +
> +color.grep.selected::
> +       Determines the non matching text (background) color of selected lines,
> +       when `--grep`, `--author` or `--committer` are used.
> +
> +color.grep.matchSelected::
> +       Determines the matching text (foreground) color of selected lines, when
> +       `--grep`, `--author` or `--committer` are used.
>  +
>  May be an unabbreviated ref name or a glob and may be specified
>  multiple times.  A warning will be issued for refs that do not exist,

The paragraph which begins "May be an unabbreviated..." belongs to the `notes.displayRef` item (which is indicated by the line containing only a `+` just before the paragraph), so this newly-inserted text incorrectly divorces the item from the rest of its description. The two new `color.grep.*` items which this patch adds should be placed after _all_ the paragraphs connected by `+` lines.

Previous: Hamza Mahfooz
Message 2 of 2 in “pretty: colorize pattern matches in commit messages”
  1. pretty: colorize pattern matches in commit messagesHamza Mahfooz, Sep 5, 2021
  2. Eric SunshineSep 5, 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.