author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sun, 5 Jun 2011 15:24:36 +0000 (17:24 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Jun 2011 01:15:27 +0000 (18:15 -0700) | ||
commit | 1d84f72ef1dee1f851e11a6d92e8ab3f1979b2a2 | |
tree | a84d8f3a9ee7118fd2ec26dc1c5c9041541187e3 | tree | snapshot |
parent | a8f0e7649eba3ce78e1f09fc4dcbb2c3fcc3d866 | commit | diff |
grep: add --heading
With --heading, the filename is printed once before matches from that
file instead of at the start of each line, giving more screen space to
the actual search results.
This option is taken from ack (http://betterthangrep.com/). And now
git grep can dress up like it:
$ git config alias.ack "grep --break --heading --line-number"
$ git ack -e --heading
Documentation/git-grep.txt
154:--heading::
t/t7810-grep.sh
785:test_expect_success 'grep --heading' '
786: git grep --heading -e char -e lo_w hello.c hello_world >actual &&
808: git grep --break --heading -n --color \
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
With --heading, the filename is printed once before matches from that
file instead of at the start of each line, giving more screen space to
the actual search results.
This option is taken from ack (http://betterthangrep.com/). And now
git grep can dress up like it:
$ git config alias.ack "grep --break --heading --line-number"
$ git ack -e --heading
Documentation/git-grep.txt
154:--heading::
t/t7810-grep.sh
785:test_expect_success 'grep --heading' '
786: git grep --heading -e char -e lo_w hello.c hello_world >actual &&
808: git grep --break --heading -n --color \
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-grep.txt | diff | blob | history | |
builtin/grep.c | diff | blob | history | |
grep.c | diff | blob | history | |
grep.h | diff | blob | history | |
t/t7810-grep.sh | diff | blob | history |