summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-07-01 22:06:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-07-02 02:16:49 (GMT)
commit2944e4e6145bdfcb1a8730d7da671786d72c86ed (patch)
treea0a293f3b48ec4a732eb4f1743f8cf6b15b041d1 /Documentation
parent49de3216983cc921ea66ade18a8521d4d74bbf3f (diff)
downloadgit-2944e4e6145bdfcb1a8730d7da671786d72c86ed.zip
git-2944e4e6145bdfcb1a8730d7da671786d72c86ed.tar.gz
git-2944e4e6145bdfcb1a8730d7da671786d72c86ed.tar.bz2
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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-grep.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index fccb82d..b3bb283 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -122,6 +122,11 @@ OPTIONS
-<num>::
A shortcut for specifying -C<num>.
+-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 <file>::
Read patterns from <file>, one per line.