git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: nanaya <edho@fastmail.com>
To: "Jeff King" <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git grep -F (fixed string) requires matching parenthesis?
Date: Tue, 13 Aug 2019 21:33:08 +0900	[thread overview]
Message-ID: <11796f65-42ec-4a0b-b1b1-a693f8eb3cf9@www.fastmail.com> (raw)
In-Reply-To: <20190813121733.GA10787@sigill.intra.peff.net>



On Tue, Aug 13, 2019, at 21:17, Jeff King wrote:
> But I think it's actually happening at a level above that. git-grep
> supports multiple patterns, which can be joined with --and, --or, --not,
> etc. And they can be grouped with parentheses.
> 
> What you're seeing is the argument parser thinking your '(' is part of
> the construction of a boolean match formula, and complaining about the
> lack of closing ')'. You can use "-e" to make it clear that it's a
> pattern (just as you'd need to for a pattern that starts with "-"):
> 
>   git grep -F -e '('
> 
> So I think everything is working as designed, though I admit the
> implication was slightly surprising to me (and note that it only happens
> with that _specific_ pattern; something like "(foo" would not be matched
> by the option parser).
> 

Thanks. That was confusing (and the error message didn't help). I've always assumed the grep is similar to posix grep so it was weird the same syntax work for fgrep but not git-grep -F.

      reply	other threads:[~2019-08-13 12:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  6:01 git grep -F (fixed string) requires matching parenthesis? nanaya
2019-08-13 12:17 ` Jeff King
2019-08-13 12:33   ` nanaya [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11796f65-42ec-4a0b-b1b1-a693f8eb3cf9@www.fastmail.com \
    --to=edho@fastmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).