author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sun, 5 Jun 2011 15:24:15 +0000 (17:24 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Jun 2011 01:10:50 +0000 (18:10 -0700) | ||
commit | 08303c3636ef750bfafd1c47f363120cb439b367 | |
tree | 4f6f843c4e7381b2c066d7f837ae3a406ca0fffd | tree | snapshot |
parent | a6605d76cdad37ed3c55a7be4d2e0af0f4721bb2 | commit | diff |
grep: fix coloring of hunk marks between files
Commit 431d6e7b (grep: enable threading for context line printing)
split the printing of the "--\n" mark between results from different
files out into two places: show_line() in grep.c for the non-threaded
case and work_done() in builtin/grep.c for the threaded case. Commit
55f638bd (grep: Colorize filename, line number, and separator) updated
the former, but not the latter, so the separators between files are
not colored if threads are used.
This patch merges the two. In the threaded case, hunk marks are now
printed by show_line() for every file, including the first one, and the
very first mark is simply skipped in work_done(). This ensures that the
output is properly colored and works just as well.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commit 431d6e7b (grep: enable threading for context line printing)
split the printing of the "--\n" mark between results from different
files out into two places: show_line() in grep.c for the non-threaded
case and work_done() in builtin/grep.c for the threaded case. Commit
55f638bd (grep: Colorize filename, line number, and separator) updated
the former, but not the latter, so the separators between files are
not colored if threads are used.
This patch merges the two. In the threaded case, hunk marks are now
printed by show_line() for every file, including the first one, and the
very first mark is simply skipped in work_done(). This ensures that the
output is properly colored and works just as well.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c | diff | blob | history | |
grep.c | diff | blob | history | |
t/t7810-grep.sh | diff | blob | history |