diff options
author | Hamza Mahfooz <someguy@effective-light.com> | 2021-09-29 07:57:15 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-29 13:23:11 -0700 |
commit | 3f566c4e695a6df8237c34b7c1f34f0832b7e575 (patch) | |
tree | 2e662ce33e4b9cf249d086568cd460cb98071350 /t/t4018/bash-posix-style-compact | |
parent | Merge branch 'jk/grep-haystack-is-read-only' into hm/paint-hits-in-log-grep (diff) | |
download | tgif-3f566c4e695a6df8237c34b7c1f34f0832b7e575.tar.xz |
grep: refactor next_match() and match_one_pattern() for external use
These changes are made in preparation of, the colorization support for the
"git log" subcommands that, rely on regex functionality (i.e. "--author",
"--committer" and "--grep"). These changes are necessary primarily because
match_one_pattern() expects header lines to be prefixed, however, in
pretty, the prefixes are stripped from the lines because the name-email
pairs need to go through additional parsing, before they can be printed and
because next_match() doesn't handle the case of
"ctx == GREP_CONTEXT_HEAD" at all. So, teach next_match() how to handle the
new case and move match_one_pattern()'s core logic to
headerless_match_one_pattern() while preserving match_one_pattern()'s uses
that depend on the additional processing.
Signed-off-by: Hamza Mahfooz <someguy@effective-light.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4018/bash-posix-style-compact')
0 files changed, 0 insertions, 0 deletions