On Fri, Dec 6, 2013 at 4:28 AM, Jeff King <peff@xxxxxxxx> wrote: > 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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html