]> git.ipfire.org Git - thirdparty/git.git/commit - grep.h
grep: add option to show whole function as context
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Mon, 1 Aug 2011 17:20:53 +0000 (19:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Aug 2011 23:09:15 +0000 (16:09 -0700)
commitba8ea7496f2b95c49fccb72ed6b332afbd865e7b
treec52a2d2007a2e209813df918dede0b05bbd08be8
parentb35acb53458d0f99ba2400b902980b35e5acc2d3
grep: add option to show whole function as context

Add a new option, -W, to show the whole surrounding function of a match.

It uses the same regular expressions as -p and diff to find the beginning
of sections.

Currently it will not display comments in front of a function, but those
that are following one.  Despite this shortcoming it is already useful,
e.g. to simply see a more complete applicable context or to extract whole
functions.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-grep.txt
builtin/grep.c
grep.c
grep.h
t/t7810-grep.sh