]> git.ipfire.org Git - thirdparty/git.git/commit - grep.c
grep: enable threading for context line printing
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Mon, 15 Mar 2010 16:21:10 +0000 (17:21 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Mar 2010 22:26:35 +0000 (15:26 -0700)
commit431d6e7bc85f693fe49a04142a8ab4d2d72b0257
treedbe24237e8e38fddb6c24f01f7ec1d3dc025b347
parentc24138bc55bcbbde2ea8601c504752e5a39f53f2
grep: enable threading for context line printing

If context lines are to be printed, grep separates them with hunk marks
("--\n").  These marks are printed between matches from different files,
too.  They are not printed before the first file, though.

Threading was disabled when context line printing was enabled because
avoiding to print the mark before the first line was an unsolved
synchronisation problem.  This patch separates the code for printing
hunk marks for the threaded and the unthreaded case, allowing threading
to be turned on together with the common -ABC options.

->show_hunk_mark, which controls printing of hunk marks between files in
show_line(), is now set in grep_buffer_1(), but only if some results
have already been printed and threading is disabled.  The threaded case
is handled in work_done().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c
grep.c