grep: print context hunk marks between files

Print a hunk mark before matches from a new file are shown, in addition
to the current behaviour of printing them if lines have been skipped.

The result is easier to read, as (presumably unrelated) matches from
different files are separated by a hunk mark.  GNU grep does the same.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2009-07-02 00:03:44 +02:00
committed by Junio C Hamano
parent 5dd06d3879
commit 046802d015
4 changed files with 40 additions and 1 deletions

1
grep.h
View File

@ -85,6 +85,7 @@ struct grep_opt {
unsigned pre_context;
unsigned post_context;
unsigned last_shown;
int show_hunk_mark;
};
extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);