Re: [BUG] redundant error message
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 6, 2013, 01:15 UTC
- Message-ID
- <CACsJy8CKDiCX0G3jD6KLZ=cyvp6zf4MT6DCY0XodfD8rkQF=wA@mail.gmail.com>
- In-Reply-To
- <20131205212851.GA21776@sigill.intra.peff.net>
On Fri, Dec 6, 2013 at 4:28 AM, Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
> BTW, the raw looping to find "--" made me wonder how we handle: > > git log --grep -- HEAD > > I'd expect it to be equivalent to: > > git log --grep=-- HEAD > > but it's not; we truncate the arguments and complain that --grep is > missing its argument. Which is probably good enough, given that the > alternative is doing a pass that understands all of the options. But it > does mean that the "--long-opt=arg" form is safer than the split form if > you are passing along an arbitrary "arg".
Maybe we could make setup_revisions() use parse_options() someday, which understands about arguments and dashdash.
$ ./git grep -e -- foo fatal: ambiguous argument 'foo': both revision and filename Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' $ ./git grep -e -- -- foo $
-- Duy