From 2944e4e6145bdfcb1a8730d7da671786d72c86ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 2 Jul 2009 00:06:34 +0200 Subject: grep: add option -p/--show-function The new option -p instructs git grep to print the previous function definition as a context line, similar to diff -p. Such context lines are marked with an equal sign instead of a dash. This option complements the existing context options -A, -B, -C. Function definitions are detected using the same heuristic that diff uses. User defined regular expressions are not supported, yet. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index fccb82deb4..b3bb283644 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -122,6 +122,11 @@ OPTIONS -:: A shortcut for specifying -C. +-p:: +--show-function:: + Show the preceding line that contains the function name of + the match, unless the matching line is a function name itself. + -f :: Read patterns from , one per line. -- cgit v1.2.1