summaryrefslogtreecommitdiff
path: root/Documentation/config/color.txt
diff options
context:
space:
mode:
authorHamza Mahfooz <someguy@effective-light.com>2021-10-07 20:31:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-08 21:19:14 (GMT)
commit6a5c337922a5221d1f6d025d84e18b526df9944c (patch)
tree79a681ce03ce5028777414f382e36c99393e3093 /Documentation/config/color.txt
parent3f566c4e695a6df8237c34b7c1f34f0832b7e575 (diff)
downloadgit-6a5c337922a5221d1f6d025d84e18b526df9944c.zip
git-6a5c337922a5221d1f6d025d84e18b526df9944c.tar.gz
git-6a5c337922a5221d1f6d025d84e18b526df9944c.tar.bz2
pretty: colorize pattern matches in commit messages
The "git log" command limits its output to the commits that contain strings matched by a pattern when the "--grep=<pattern>" option is used, but unlike output from "git grep -e <pattern>", the matches are not highlighted, making them harder to spot. 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). Also, it must be noted that we are effectively greping the content twice (because it would be a hassle to rework the existing matching code to do a /g match and then pass it all down to the coloring code), however it only slows down "git log --author=^H" on this repository by around 1-2% (compared to v2.33.0), so it should be a small enough slow down to justify the addition of the feature. Signed-off-by: Hamza Mahfooz <someguy@effective-light.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config/color.txt')
-rw-r--r--Documentation/config/color.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/config/color.txt b/Documentation/config/color.txt
index e05d520..91d9a9d 100644
--- a/Documentation/config/color.txt
+++ b/Documentation/config/color.txt
@@ -104,9 +104,12 @@ color.grep.<slot>::
`matchContext`;;
matching text in context lines
`matchSelected`;;
- matching text in selected lines
+ matching text in selected lines. Also, used to customize the following
+ linkgit:git-log[1] subcommands: `--grep`, `--author` and `--committer`.
`selected`;;
- non-matching text in selected lines
+ non-matching text in selected lines. Also, used to customize the
+ following linkgit:git-log[1] subcommands: `--grep`, `--author` and
+ `--committer`.
`separator`;;
separators between fields on a line (`:`, `-`, and `=`)
and between hunks (`--`)