git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: git@vger.kernel.org
Subject: Re: git-grep: option parsing conflicts with prefix-dash searches
Date: Fri, 05 Feb 2010 15:34:51 -0800	[thread overview]
Message-ID: <7v7hqrs1d0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LSU.2.01.1002060009430.30204@obet.zrqbmnf.qr> (Jan Engelhardt's message of "Sat\, 6 Feb 2010 00\:17\:49 +0100 \(CET\)")

Jan Engelhardt <jengelh@medozas.de> writes:

> On Saturday 2010-02-06 00:09, Jan Engelhardt wrote:
>
>>What works is (3).
>>
>>(3)	$ git grep -- -- '->cnt' net/ipv4/netfilter/
>
> No, I spoke too soon. This command will search for --, not ->cnt.
> So git cannot search for patterns starting with a dash at all,
> as I see it. This is getting fun..
>
>>As I said, it's a mess. And I know not whether any code can convince
>>the "but we need to watch compatibility"-sayers, because this would
>>definitely be a flag change.

I guess our mails crossed.  You don't have to worry about "flag change",
as I don't think there is any change necessary.

You just need to learn:

 (1) "-e" can come before a string to tell git: "this might look like
     an option to you but it isn't; it is what I am looking for"; and

 (2) Everything that follows "--" are pathspecs, not revs nor options.

And all is well.

  parent reply	other threads:[~2010-02-05 23:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 23:09 git-grep: option parsing conflicts with prefix-dash searches Jan Engelhardt
2010-02-05 23:17 ` Jan Engelhardt
2010-02-05 23:27   ` Santi Béjar
2010-02-05 23:34   ` Junio C Hamano [this message]
2010-02-05 23:31 ` Junio C Hamano
2010-02-06  3:51   ` Jeff King
2010-02-06  4:53     ` Junio C Hamano
2010-02-06  8:17       ` Miles Bader
2010-02-06 11:58       ` Jeff King
2010-02-06 17:39         ` Junio C Hamano
2010-02-07  4:44           ` Jeff King
2010-02-08  1:06             ` Junio C Hamano

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=7v7hqrs1d0.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jengelh@medozas.de \
    /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).