Re: [PATCH] grep: fix match highlighting for combined patterns with context lines

2014-10-26 Thread René Scharfe
Am 21.10.2014 um 07:56 schrieb Zoltan Klinger: When git grep is run with combined patterns such as '-e p1 --and -e p2' and surrounding context lines are requested, the output contains incorrectly highlighted matches. Consider the following output (highlighted matches are surrounded by '*'

Re: [PATCH] grep: fix match highlighting for combined patterns with context lines

2014-10-22 Thread Junio C Hamano
Zoltan Klinger zoltan.klin...@gmail.com writes: Junio C Hamano gits...@pobox.com writes: It turns out that the result of such a change becomes more readable than the original, in that it makes it clear that reinspection of the lines are done only for matched ones and not context lines.

Re: [PATCH] grep: fix match highlighting for combined patterns with context lines

2014-10-21 Thread Junio C Hamano
Zoltan Klinger zoltan.klin...@gmail.com writes: When git grep is run with combined patterns such as '-e p1 --and -e p2' and surrounding context lines are requested, the output contains incorrectly highlighted matches. Consider the following output (highlighted matches are surrounded by '*'

Re: [PATCH] grep: fix match highlighting for combined patterns with context lines

2014-10-21 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: If your goal is to stop colouring words on context and other kinds of lines, do you still need the while (next_match(...)) loop for them? Can't you make the resulting code clearer by restructuring the inside of the whole if (opt-color) block further,

Re: [PATCH] grep: fix match highlighting for combined patterns with context lines

2014-10-21 Thread Zoltan Klinger
Junio C Hamano gits...@pobox.com writes: It turns out that the result of such a change becomes more readable than the original, in that it makes it clear that reinspection of the lines are done only for matched ones and not context lines. Agree, it looks much clearer now. Happy if you

[PATCH] grep: fix match highlighting for combined patterns with context lines

2014-10-20 Thread Zoltan Klinger
When git grep is run with combined patterns such as '-e p1 --and -e p2' and surrounding context lines are requested, the output contains incorrectly highlighted matches. Consider the following output (highlighted matches are surrounded by '*' characters): $ cat testfile foo a foo b