Re: multiple source file extensions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 1, 2015 at 10:11 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Fri, May 01, 2015 at 08:49:14PM -0400, Josh Hagins wrote:
>
>> 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?
>
> That will only pick up files that are in the working tree. Which is fine
> for a stock "git grep" with no options, but would not be right for
> grepping in the index or an older tree. For that, you can ask git to
> glob for you:
>
>   git grep pattern -- '*.cc' '*.cpp' '*.h'
>
Is it possible to do a regex like the following?

".*\.[cChH]\(pp\)?"

http://stackoverflow.com/questions/277999/how-to-use-the-unix-find-command-to-find-all-the-cpp-and-h-files/3858879#3858879

-- 
Thiago Farina
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]