git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] grep: add --heading

From
Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Date
Jun 6, 2011, 12:26 UTC
Message-ID
<loom.20110606T141954-541@post.gmane.org>
In-Reply-To
<4DEB9FB4.8020904@lsrfire.ath.cx>
René Scharfe <rene.scharfe <at> lsrfire.ath.cx> writes:
Show 15 quoted lines
> 
> 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 \
> 
Nice! I really missed that.

You can also add --perl-regexp (since 1.7.6-rc0) to alias.ack to achive more compability with ack (although it uses Perl regexes, not PCRE).

Previous: René Scharfe
Message 5 of 5 in “grep: add result grouping, ack style”
  1. 0/3 grep: add result grouping, ack styleRené Scharfe, Jun 5, 2011
  2. 1/3 grep: fix coloring of hunk marks between filesRené Scharfe, Jun 5, 2011
  3. 2/3 grep: add --breakRené Scharfe, Jun 5, 2011
  4. 3/3 grep: add --headingRené Scharfe, Jun 5, 2011
  5. Michał KiedrowiczJun 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.