Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes: > On Sat, Apr 9, 2011 at 11:56 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > >> ... If you rewrite the verify_filename() in the >> way I outlined above, you wouldn't have to. > > I considered that, but we may need to go through the whole worktree > just to verify "*.c" matches something. You are absolutely right. After all, this is only meant to be a quick sanity check to ensure that we got the user's intention absolutely right when the user did not disambiguate with '--'. When we see all earlier ones are object names (and cannot be filenames) and all later ones have working tree entries (and cannot be object names), we are sure that we got the missing '--' boundary right. And we error out when there is any doubt, and that is a good feature. Even when there is no glob involved, e.g. "git log builtin-add.c", we fail the parsing, because there is no builtin-add.c in the filesystem in today's checkou. That behaviour is coming exactly from that reasoning: we may be sure that "builtin-add.c" cannot be an object name, but we don't know if it is a typo of builtin/add.c (or builtin-add.o, etc.), and we don't want to make the user wait while we are guessing. So let's forget about the suggestion. Thanks for injecting sanity to the discussion and stopping me from going overboard. -- 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