From: Jeff King <peff@peff.net>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: "Thiago Farina" <tfransosi@gmail.com>,
"Josh Hagins" <hagins.josh@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>,
"Duy Nguyễn" <pclouds@gmail.com>
Subject: Re: multiple source file extensions
Date: Tue, 5 May 2015 15:12:38 -0400 [thread overview]
Message-ID: <20150505191238.GC10463@peff.net> (raw)
In-Reply-To: <CAHYJk3TzZd8N6E+=nNi1jR36Zc5A7be8ZPL9jLU7c8uAdQJYBw@mail.gmail.com>
On Tue, May 05, 2015 at 07:30:00PM +0200, Mikael Magnusson wrote:
> >> ".*\.[cChH]\(pp\)?"
> >
> > No, pathspecs are globs, not regexps. I think the idea has been floated
> > for supporting regexps, which you would activate something like:
> >
> > git grep pattern -- :(regexp)$your_regex_here
> >
> > but nobody has implemented it. I'm not sure it actually saves you any
> > typing (besides which, your regexp does not match ".cc", which was in
> > the original).
>
> Remember that the more bells and whistles you add to pathspecs, the
> less actual filenames can be conveniently tracked by git; *.c will be
> expanded by the shell and passed literally to git, and if git then
> interprets a bunch of stuff again, you could end up with a false
> negative or positive match. Obviously files with * and ? in them are
> already unsupported, try not to add more.
I agree this is a problem, but I think we have already crossed that
bridge, and going forward:
1. Any new bells and whistles will have to be activated explicitly
(that's what the ":(regexp)" syntax is).
2. The ":()" magic is already there, so add it to "*" and "?" in the
list of obstacles.
3. There is ":(literal)", "--literal-pathspecs", and $GIT_LITERAL_PATHSPECS
to turn off all magic.
-Peff
prev parent reply other threads:[~2015-05-05 19:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-02 0:40 multiple source file extensions Thiago Farina
2015-05-02 0:49 ` Josh Hagins
2015-05-02 1:11 ` Jeff King
2015-05-02 2:04 ` Duy Nguyen
2015-05-02 2:11 ` Duy Nguyen
2015-05-02 2:35 ` Jeff King
2015-05-02 7:11 ` Eric Sunshine
2015-05-03 2:26 ` Junio C Hamano
2015-05-02 2:33 ` Jeff King
2015-05-04 22:12 ` Thiago Farina
2015-05-05 3:43 ` Jeff King
2015-05-05 17:30 ` Mikael Magnusson
2015-05-05 19:12 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150505191238.GC10463@peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=hagins.josh@gmail.com \
--cc=mikachu@gmail.com \
--cc=pclouds@gmail.com \
--cc=tfransosi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).