From: Junio C Hamano Date: Tue, 9 May 2006 06:55:47 +0000 (-0700) Subject: builtin-grep: tighten argument parsing. X-Git-Tag: v1.4.0-rc1~142^2~6 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;ds=sidebyside;h=5acd64edec37a7d9783af1a2be99772d466e8f02;hp=5acd64edec37a7d9783af1a2be99772d466e8f02;p=git.git builtin-grep: tighten argument parsing. I mistyped git grep next -e '"^@"' '*.c' and got many hits that contain "next" without complaint. Obviously what I meant to say was: git grep -e '"^@"' next -- '*.c' This tightens the argument parsing rule a bit: - All "grep" parameters should come first; - If there is no -e nor -f to specify pattern, the first non option string is the parameter; - After that, zero or more revs can follow. - An optional '--' can be present, and is skipped. - All the rest are pathspecs. If '--' was not there, they must be paths that exist in the working tree. Signed-off-by: Junio C Hamano ---