From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: git-grep documentation Date: Sat, 21 Jan 2006 00:09:07 -0800 Message-ID: <7vvewet330.fsf@assigned-by-dhcp.cox.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sat Jan 21 09:09:29 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F0DoH-0005fJ-5i for gcvg-git@gmane.org; Sat, 21 Jan 2006 09:09:21 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751094AbWAUIJK (ORCPT ); Sat, 21 Jan 2006 03:09:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751126AbWAUIJK (ORCPT ); Sat, 21 Jan 2006 03:09:10 -0500 Received: from fed1rmmtao08.cox.net ([68.230.241.31]:47870 "EHLO fed1rmmtao08.cox.net") by vger.kernel.org with ESMTP id S1751094AbWAUIJJ (ORCPT ); Sat, 21 Jan 2006 03:09:09 -0500 Received: from assigned-by-dhcp.cox.net ([68.4.9.127]) by fed1rmmtao08.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060121080656.ORJH26964.fed1rmmtao08.cox.net@assigned-by-dhcp.cox.net>; Sat, 21 Jan 2006 03:06:56 -0500 To: sean User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: 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' [