Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: git-grep: option parsing conflicts with prefix-dash searches

From: Santi Béjar <hidden>
Date: 2016-06-15 22:48:11

On Sat, Feb 6, 2010 at 12:17 AM, Jan Engelhardt [off-list ref] wrote:
On Saturday 2010-02-06 00:09, Jan Engelhardt wrote:
quoted
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..
You should use -e:

     -e
           The next parameter is the pattern. This option has to be
used for patterns starting with - and should be used in scripts
passing user input to grep.

The working command is:

$ git grep -e '->cnt' net/ipv4/netfilter/

Although there is not such pattern in net/ipv4/netfilter, maybe you
wanted '->counters' :-)

HTH,
Santi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help