Commit 3f566c4
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>1 parent 28ecef4 commit 3f566c4
2 files changed
+58
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | 959 | | |
979 | 960 | | |
980 | 961 | | |
| |||
1025 | 1006 | | |
1026 | 1007 | | |
1027 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1028 | 1039 | | |
1029 | 1040 | | |
1030 | 1041 | | |
| |||
1143 | 1154 | | |
1144 | 1155 | | |
1145 | 1156 | | |
1146 | | - | |
| 1157 | + | |
1147 | 1158 | | |
1148 | 1159 | | |
1149 | 1160 | | |
| |||
1158 | 1169 | | |
1159 | 1170 | | |
1160 | 1171 | | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1164 | 1176 | | |
1165 | 1177 | | |
1166 | 1178 | | |
1167 | 1179 | | |
1168 | 1180 | | |
1169 | 1181 | | |
1170 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1171 | 1185 | | |
1172 | | - | |
1173 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1174 | 1192 | | |
1175 | 1193 | | |
1176 | 1194 | | |
| |||
1261 | 1279 | | |
1262 | 1280 | | |
1263 | 1281 | | |
1264 | | - | |
| 1282 | + | |
| 1283 | + | |
1265 | 1284 | | |
1266 | 1285 | | |
1267 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
| |||
0 commit comments