builtin-grep: tighten argument parsing.
authorJunio C Hamano <junkio@cox.net>
Tue, 9 May 2006 06:55:47 +0000 (23:55 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 9 May 2006 06:55:47 +0000 (23:55 -0700)
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 <junkio@cox.net>

No differences found