From: Junio C Hamano Date: Sat, 21 Jan 2006 08:09:07 GMT Subject: Re: git-grep documentation Message-ID: <7vvewet330.fsf@assigned-by-dhcp.cox.net> In-Reply-To: sean writes: > It looks as though git-grep.sh was coded to allow git-ls-files > options to be passed after a '--' marker... I'd prefer to keep the options before path parameters if only for the sanity's sake. How about this instead? -- >8 -- [PATCH] git-grep: clarification on parameters. We forgot to make sure that there is no more than one pattern parameter. Also when looking for files in a directory called '--others', it passed that path limiter without preceding the end-of-options marker '--' to underlying git-ls-files, which misunderstood it as one of its options instead. $ git grep --others -e Meta/Make Meta $ git grep -o -e Meta/Make Meta $ git grep -o Meta/Make Meta look for a string "Meta/Make" from untracked files in Meta/ directory. $ git grep Meta/Make --others looks for the same string from tracked files in ./--others directory. On the other hand, $ git grep -e Meta/Make --others does not have a freestanding pattern, so everybody is parameter and there is no path specifier. It looks for the string in all the untracked files without any path limiter. Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 25 ++++++++++++++++++++++--- git-grep.sh | 27 +++++++++++++++++++-------- 2 files changed, 41 insertions(+), 11 deletions(-) b11f9315a792d65a0113e10e478e740ce4f8be73 diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 2bfd8ed..55d3bed 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -8,7 +8,7 @@ git-grep - print lines matching a patter SYNOPSIS -------- -'git-grep' [