grep: Add the option '--open-files-in-pager'
commit526cf115507683c4b867acf169befab9bcc9d795
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 23 Apr 2009 10:50:22 +0000 (23 12:50 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 7 Feb 2010 19:04:28 +0000 (7 20:04 +0100)
treec3031e2ac14d42ff53feff0a8eacc7b7198e6781
parent153c9e65cb79c71fdc3fc5f89e8ac2ec3446d0b8
grep: Add the option '--open-files-in-pager'

This adds an option to open the matching files in the pager, and if the
pager happens to be "less" (or "vi") and there is only one grep pattern,
it also jumps to the first match right away.

So, 'git grep -P abc' is a short form for 'less +/abc $(grep -l abc)'
except that it works also with spaces in file names, and it does not
start the pager if there was no matching file.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Documentation/git-grep.txt
builtin-grep.c
git.c