diff options
author | Hamza Mahfooz <someguy@effective-light.com> | 2021-10-07 16:31:47 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-08 14:19:14 -0700 |
commit | 6a5c337922a5221d1f6d025d84e18b526df9944c (patch) | |
tree | 79a681ce03ce5028777414f382e36c99393e3093 /Documentation/git-apply.txt | |
parent | grep: refactor next_match() and match_one_pattern() for external use (diff) | |
download | tgif-6a5c337922a5221d1f6d025d84e18b526df9944c.tar.xz |
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/git-apply.txt')
0 files changed, 0 insertions, 0 deletions