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

Re: [PATCH] built-in "git grep" (git grip).

From
Linus Torvalds <torvalds@osdl.org>
Date
May 1, 2006, 15:48 UTC
Message-ID
<Pine.LNX.4.64.0605010842130.21189@g5.osdl.org>
In-Reply-To
<20060501145328.GA14856@mars.ravnborg.org>
On Mon, 1 May 2006, Sam Ravnborg wrote:
Show 6 quoted lines
> 
> Seems I have confused myself.
>
>	git grep DEBUG '*/Kconfig*'
>
> does indeed work today.

Indeed. I was a bit confused about your report, since not only does it work today, that's how it has always worked, and it was very much designed that way. I use it all the time.

It takes the git-ls-files pathname syntax, which is a bit _different_ from the normal "limit to these paths" syntax, in that it honors '*'. And it honors that a bit differently than normal shell pathname expansion, because for git-ls-files a '*' pattern will match '/' as well.

So
	git grep pattern 'net/*.c'

will match every single C file found _recursively_ inside the "net/" subdirectory, not just in that single directory itself.

So "*" for git grep is a bit more like a "**" pattern in some shells.
		Linus
Previous: Sam RavnborgNext: Junio C Hamano
Message 19 of 21 in “built-in "git grep" (git grip).”
  1. built-in "git grep" (git grip).Junio C Hamano, May 1, 2006
  2. Jakub NarebskiMay 1, 2006
  3. Junio C HamanoMay 1, 2006
  4. Jakub NarebskiMay 1, 2006
  5. Andreas EricssonMay 2, 2006
  6. Jakub NarebskiMay 2, 2006
  7. Junio C HamanoMay 2, 2006
  8. Jakub NarebskiMay 2, 2006
  9. Andreas EricssonMay 2, 2006
  10. Junio C HamanoMay 2, 2006
  11. Linus TorvaldsMay 2, 2006
  12. Junio C HamanoMay 2, 2006
  13. Linus TorvaldsMay 2, 2006
  14. Junio C HamanoMay 3, 2006
  15. built-in "git grep" (git grip) - quickfixJunio C Hamano, May 1, 2006
  16. Sam RavnborgMay 1, 2006
  17. Sam RavnborgMay 1, 2006
  18. Sam RavnborgMay 1, 2006
  19. Linus TorvaldsMay 1, 2006
  20. builtin-grep: wildcard pathspec fixesJunio C Hamano, May 1, 2006
  21. builtin-grep: do not use setup_revisions()Junio C Hamano, May 1, 2006

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.