summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-09-24 15:09:48 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2005-09-24 15:09:48 -0700
commitc9fc748f84857a237f47deb91f87499e82865c83 (patch)
treea4b6974079bfa443384a8772c0d18fe7afbae8be
parentFurther clarify licensing status of compat/subprocess.py. (diff)
downloadtgif-c9fc748f84857a237f47deb91f87499e82865c83.tar.xz
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 <junkio@cox.net>
-rwxr-xr-xgit-grep.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-grep.sh b/git-grep.sh
index 51924fd7c3..e7a35ebd70 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"