grep with show-function

November 12, 2012

You can grep sources and see context function like with diff –show-c-function or diff -p.

Search sources stored in git and show the preceding line that contains the function name of the match:

git grep –show-function STR

Same, but search files not in git, even without git repository:

git grep –no-index –show-function STR

References:
git grep

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: