From c9fc748f84857a237f47deb91f87499e82865c83 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 24 Sep 2005 15:09:48 -0700 Subject: git-grep: fix 'git grep -e $pattern' handling People typically say 'grep -e $pattern' because $pattern has a leading dash which would be mistaken as a grep flag. Make sure we pass -e in front of $pattern when we invoke grep. Signed-off-by: Junio C Hamano --- git-grep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-grep.sh b/git-grep.sh index 51924fd7c..e7a35ebd7 100755 --- a/git-grep.sh +++ b/git-grep.sh @@ -40,4 +40,4 @@ while : ; do shift done git-ls-files -z "${git_flags[@]}" "$@" | - xargs -0 grep "${flags[@]}" "$pattern" + xargs -0 grep "${flags[@]}" -e "$pattern" -- cgit v1.2.1