From: Junio C Hamano Date: Sat, 06 Feb 2010 04:53:36 GMT Subject: Re: git-grep: option parsing conflicts with prefix-dash searches Message-ID: <7v7hqrdkxb.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100206035143.GA31784@sigill.intra.peff.net> Jeff King writes: > The worst I could come up with is the > double-double-dash case: > > git grep -- pattern revision -- pathname > > It is perhaps not as pretty as > > git grep -e pattern revision -- pathname > > but I don't think it is ambiguous. I don't think if "ambiguous or not" is what we are after to begin with. I have known GNU extended grep implementations long enough but never saw that "--" used to quote a pattern. Is it worth supporting to begin with? > So actually my patch above is breaking somebody who truly wanted to grep > for "--" by doing > > git grep -- > > but that is sufficiently insane that I'm not too worried about it. I would say "git grep -- pattern" is sufficiently insane enough that I'm not worried about it at all. Interpreting "git grep --" as a request to look for double-dash feels million times saner than that, actually. Unless somebody comes up with example of that pattern's wide use. Point me to some well known open source software's source trees that use "--" for such a purpose in one of its shell script or Makefile.