Re: multiple source file extensions
- From
Jeff King <peff@peff.net>
- Date
- May 2, 2015, 02:35 UTC
- Message-ID
- <20150502023504.GC587@peff.net>
- In-Reply-To
- <CACsJy8C2aztHWHP0_U8VWJxMrT2HE7aYBxDQTnSWS1TVwCnedw@mail.gmail.com>
On Sat, May 02, 2015 at 09:11:16AM +0700, Duy Nguyen wrote:
Show 14 quoted lines
> On Sat, May 2, 2015 at 9:04 AM, Duy Nguyen <pclouds@gmail.com> wrote:
> > On Fri, May 01, 2015 at 09:11:01PM -0400, Jeff King wrote:
> >> Unfortunately there is no way to use curly braces with git's pathspec,
> >> so you have to write out three separate `*` arguments rather than using
> >> the shell-style {cc,cpp,h}.
> >
> > Noted. Need to add curly brace support in pathspec :-)
>
> Naah people can just do
>
> git grep pattern -- '*'.{cc,cpp,h}
>
> and bash will take care of expanding it into three separate arguments.
> Obscure, but pathspec is also obscure..Thanks, I had a vague notion that I should be able to convince the shell to do it for me, but of course "*.{cc,cpp,h}" doesn't work. I always forget about breaking up parameters into two parts with different quoting like this.
I agree we don't really need curly braces in pathspecs. :)
-Peff