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

Re: multiple source file extensions

From
JHJosh Hagins <hagins.josh@gmail.com>
Date
May 2, 2015, 00:49 UTC
Message-ID
<CANuW5x3OBWNDnHeVbH7ZQaj5AUAingea6crJ0cF9AHFjcJE_bQ@mail.gmail.com>
In-Reply-To
<CACnwZYed_aHzLsbkJVm=OnydXw-CPi-Zm9V7928rzvpaFMNENw@mail.gmail.com>

If you're using a recent version of bash, you could enable the 'globstar' option:

    $ shopt -s globstar
    $ git grep 'pattern' **/*.{cc,cpp,h}
Does that work?
On Fri, May 1, 2015 at 8:40 PM, Thiago Farina <tfransosi@gmail.com> wrote:
Show 16 quoted lines
> Hey!
>
> How do I tell 'git grep' to search only in .cc, .cpp and .h files?
>
> From http://gitster.livejournal.com/27674.html it seems possible to do
> some filter, but in this article grep is told to search only in C
> source files.
>
> Bye!
>
> --
> Thiago Farina
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Josh Hagins
College of Engineering
Cornell University '14
(843) 847-6008
Previous: Thiago FarinaNext: Jeff King
Message 2 of 13 in “multiple source file extensions”
  1. Thiago FarinaMay 2, 2015
  2. Josh HaginsMay 2, 2015
  3. Jeff KingMay 2, 2015
  4. Duy NguyenMay 2, 2015
  5. Duy NguyenMay 2, 2015
  6. Jeff KingMay 2, 2015
  7. Eric SunshineMay 2, 2015
  8. Junio C HamanoMay 3, 2015
  9. Jeff KingMay 2, 2015
  10. Thiago FarinaMay 4, 2015
  11. Jeff KingMay 5, 2015
  12. Mikael MagnussonMay 5, 2015
  13. Jeff KingMay 5, 2015

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.