Skip to content
  • René Scharfe's avatar
    grep: add --heading · 1d84f72e
    René Scharfe authored and Junio C Hamano's avatar Junio C Hamano committed
    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: default avatarRene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    1d84f72e