summaryrefslogtreecommitdiff
path: root/Documentation/git-grep.txt
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-06-05 17:24:36 +0200
committerJunio C Hamano <gitster@pobox.com>2011-06-05 18:15:27 -0700
commit1d84f72ef1dee1f851e11a6d92e8ab3f1979b2a2 (patch)
treea84d8f3a9ee7118fd2ec26dc1c5c9041541187e3 /Documentation/git-grep.txt
parenta8f0e7649eba3ce78e1f09fc4dcbb2c3fcc3d866 (diff)
downloadgit-1d84f72ef1dee1f851e11a6d92e8ab3f1979b2a2.tar.gz
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>
Diffstat (limited to 'Documentation/git-grep.txt')
-rw-r--r--Documentation/git-grep.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index dea7cad0c2..07b3c6a086 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -151,6 +151,10 @@ OPTIONS
--break::
Print an empty line between matches from different files.
+--heading::
+ Show the filename above the matches in that file instead of
+ at the start of each shown line.
+
-[ABC] <context>::
Show `context` trailing (`A` -- after), or leading (`B`
-- before), or both (`C` -- context) lines, and place a